#include #include using namespace std; int maxs(int x, int y) { if (x > y) return x; return y; } int mins(int x, int y) { if (x < y) return x; return y; } int m, n; int N; char a[200], b[200]; int flag; int main() { scanf("%d", &N); while (scanf("%d", &N) != EOF) { scanf("%s", a); scanf("%s", b); flag = 1; for (int i = 0; i < N; i++) { if (!((a[i] == 'A' && b[i] == 'U') || (a[i] == 'T' && b[i] == 'A') || (a[i] == 'C' && b[i] == 'G') || (a[i] == 'G' && b[i] == 'C'))) { flag = 0; break; } } if (flag) { printf("YES\n"); } else { printf("NO\n"); } } return 0; }