import static java.lang.System.err; import java.util.Arrays; public class Main { public static void main(String[] args) { java.io.PrintWriter out = new java.io.PrintWriter(System.out); new Main(out); out.flush(); err.flush(); } /* * 1. k=Nのとき: 2択 * 2. k> 1;++ i) { A[i] ^= A[N - i - 1]; A[N - i - 1] ^= A[i]; A[i] ^= A[N - i - 1]; } yes |= Arrays.equals(A, B); out.println(yes ? "Yes" : "No"); } else { Arrays.sort(A); Arrays.sort(B); out.println(Arrays.equals(A, B) ? "Yes" : "No"); } } } }