//MJRT #include #include #include #include ////////////////////// #include #include #include #include #include #include #include /////////////////////// #include #include #include #include #include #include #include /////////////////////// //#include //pd_bs库,hdu&&poj不支持 using namespace std; #define lch(x) ((x) << 1) #define rch(x) ((x)<<1|1) #define dad(x) ((x)>>1) #define lowbit(x) ((x)&(-x)) static int INDEX = 0, BUGs = 0; #define BUG() cout << "There is BUG No." << BUGs++ <> 1; const int N = 5 + 100; bool vis[N]; char dna[N], rna[N]; char xxx[4] ; char yyy[4] ; map mp; bool check(int i); int main() { //ios::sync_with_stdio(false); #ifndef ONLINE_JUDGE freopen("in.txt", "r", stdin); //freopen("out.txt", "w", stdout); #endif xxx[0] = 'A' ,xxx[1] = 'T' ,xxx[2] = 'C' , xxx[3] = 'G'; yyy[0] = 'U' ,yyy[1] = 'A' ,yyy[2] = 'G' , yyy[3] = 'C'; for(int i = 0 ; i < 4 ; i++) { mp[xxx[i] ] = yyy[i]; } int Case, n; scanf("%d", &Case); while(Case--) { scanf("%d", &n); getchar(); gets(dna); gets(rna); int flag = 1; for(int i = 0 ; i < n ; i++) { if(!check(i)) { flag = 0; break; } } puts(flag ? "YES" : "NO"); } return 0; } bool check(int i) { if(mp[dna[i] ] == rna[i]) return 1; return 0; }