AT_past18_g 二回の交換

Description

You are given length- $ N $ sequences $ A = (A_1, A_2, \ldots, A_N) $ and $ B = (B_1, B_2, \ldots, B_N) $ . You will apply the following operation against the sequence $ A $ exactly twice. - Choose an integer $ i $ with $ 1 \leq i < N $ , and swap the values of $ A_i $ and $ A_{i + 1} $ . Determine if you can make $ A = B $ by operating exactly twice.

Input Format

The input is given from Standard Input in the following format: > $ N $ $ A_1 $ $ A_2 $ $ \ldots $ $ A_N $ $ B_1 $ $ B_2 $ $ \ldots $ $ B_N $

Output Format

Print `Yes` if you can make $ A = B $ by operating exactly twice, and `No` otherwise.

Explanation/Hint

### Sample Explanation 1 You can make $ A = B $ by operating exactly twice as follows: - Choose $ i = 1 $ . Swap the values of $ A_1 $ and $ A_2 $ to make $ A = (3, 1, 5, 5, 2) $ . - Choose $ i = 4 $ . Swap the values of $ A_4 $ and $ A_5 $ to make $ A = (3, 1, 5, 2, 5) $ . ### Constraints - $ 2 \leq N \leq 2 \times 10^5 $ - $ 1 \leq A_i, B_i \leq N $ - All input values are integers.