#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define MAX_N 110 const int INF = 0x3f3f3f3f; int n; char s1[MAX_N]; char s2[MAX_N]; void solve() { for(int i = 0 ;i < n ;i++) { if(s1[i] == 'A' && s2[i] != 'U' || s1[i] == 'T' && s2[i] != 'A' || s1[i] == 'C' && s2[i] != 'G' || s1[i] == 'G' && s2[i] != 'C') { printf("NO\n"); return; } } printf("YES\n"); } int main() { int t; scanf("%d", &t); while(t--) { scanf("%d", &n); scanf("%s%s", s1, s2); solve(); } return 0; }