// uso #include #include using namespace std; bool solve() { int N; cin >> N; vector A(N * 2); for (auto &x : A) cin >> x; if (A[0] != 1 or A.back() != N) return false; for (int i = 1; i < int(A.size()); i++) { if (A[i - 1] == A[i]) return false; } return true; } int main() { cin.tie(nullptr), ios::sync_with_stdio(false); int T; cin >> T; while (T--) cout << (solve() ? "Yes" : "No") << '\n'; }