| OMORI CONTEST |
|---|
| Закончено |
Sunny has been practicing his violin a lot, preparing for his recital with his older sister Mari; his violin has $$$2\times 10^{18} +1$$$ micro-strings indexed from $$$-10^{18}$$$ to $$$10^{18}$$$ from left to right.
There are $$$n$$$ vibrations on the strings; the $$$i$$$-th vibration $$$(1 \le i \le n)$$$ is located on the string with index $$$a_i$$$. No two vibrations are located on the same string. Since Sunny has been practicing a lot, he can precisely choose one string $$$k$$$ $$$(-10^{18} \le k \le 10^{18})$$$ and play a note on it.
When Sunny plays a note on string $$$k$$$, every vibration existing to the right of this string gets shifted to the next string to its right, and every vibration to the left of this string gets shifted to the next string to its left, and if a vibration exists on string $$$k$$$, it stays on string $$$k$$$. More formally, when Sunny hits string $$$k$$$, the following happens simultaneously for each vibration $$$i$$$:
Now, Mari wants Sunny to make the vibrations on the violin have indices $$$b_1, b_2, ..., b_n$$$; since Sunny wants to make his sister feel proud, he wants to know if it is possible to change the initial positions $$$a$$$ of the $$$n$$$ vibrations to the desired positions $$$b$$$. Sunny can play an arbitrary number of notes (including not playing any note).
The first line of input contains one integer $$$n$$$ $$$(1 \le n \le 2\times 10^5)$$$ — the number of vibrations currently on Sunny's violin.
The next line contains $$$n$$$ integers $$$a_1, a_2, ..., a_n$$$ $$$(1 \le a_1 \lt a_2 \lt ... \lt a_n \le 10^9)$$$ separated by spaces — the initial positions of the vibrations on the violin.
The next line contains $$$n$$$ integers $$$b_1, b_2, ..., b_n$$$ $$$(1 \le b_1 \lt b_2 \lt ... \lt b_n \le 10^9)$$$ separated by spaces — the desired positions of the vibrations on the violin.
Output one line containing the word "YES" (without quotes) if it is possible for Sunny to convert the positions of the vibrations to the desired positions by his sister by playing notes on his violin's strings, and print "NO" (without quotes) otherwise.
4 3 4 5 6 3 5 6 8
YES
4 3 4 5 6 3 4 7 8
NO
In the first example, Sunny can play the following notes to convert array $$$a$$$ into $$$b$$$:
Sunny practicing on his violin
| Название |
|---|


