#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(ll i=0;i> T; while(T--){ ll N; cin >> N; map x,y; REP(i,2*N){ ll a,b; char t; cin >> a >> b >> t; if(t=='x'){ x[b]++; } else{ y[a]++; } } ll sx=0,sy=0; for(auto c:x) sx+=c.second%2; for(auto c:y) sy+=c.second%2; if(sx==sy) cout << "Yes" << endl; else cout << "No" << endl; } return 0; }