#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; void flip(int l, int r, vector &A){ for (int i=0; i<(r-l+1)/2; i++) swap(A[l+i], A[r-i]); } void solve(){ int N; cin >> N; vector A(2*N), X(2*N); for (int i=0; i<2*N; i++){ cin >> A[i]; A[i]--; X[i] = i%N; } if (A == X){ cout << "Yes" << endl; return; } for (int i=0; i> T; while(T){ T--; solve(); } return 0; }