#include #define rep(i, n) for (int i = 0; i < (n); ++i) using std::cin; using std::cout; using std::map; int main() { int t; cin >> t; while (t--) { int n; cin >> n; n *= 2; bool ok = true; map mp; rep(i, n) { int a; cin >> a; if (mp.count(a) and i - mp[a] <= 1) ok = false; mp[a] = i; } puts(ok ? "Yes" : "No"); } return 0; }