#include using namespace std; using ll = long long; const ll MOD = 1000000007; using P = pair; #define rep(i, n) for(int i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() int main(){ int t; cin >> t; rep(i,t){ int n; bool ans = true; cin >> n; vector a(2*n); vector> ad(n); rep(j,2*n){ cin >> a[j]; ad[a[j]-1].push_back(j); if(ad[a[j]-1].size()>2) ans = false; } rep(j,n){ if(ad[j][1] - ad[j][0] == 1) ans = false; } if(ans) cout << "Yes" << endl; else cout << "No" << endl; } return 0; }