#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  os << "{" << p.first << "," << p.second << "}";
  return os;
}
const int N = 3e5 + 5;
const int oo = 1e9 + 7;
int cnt1[500];
int cnt2[500];
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int T, cs = 0;
  cin >> T;
  while (T--) {
    memset(cnt1, 0, sizeof cnt1);
    memset(cnt2, 0, sizeof cnt2);
    string s, t;
    int n;
    cin >> n;
    cin >> s >> t;
    bool x = 0, y = 0;
    for (char c : s) {
      for (char k = c + 1; k <= 'z'; k++)
        if (cnt1[k] % 2) x = !x;
      cnt1[c]++;
    }
    for (char c : t) {
      for (char k = c + 1; k <= 'z'; k++)
        if (cnt2[k] % 2) y = !y;
      cnt2[c]++;
    }
    bool ok = 1, ok1 = 0;
    for (char c = 'a'; c <= 'z'; c++)
      ok = ok and cnt1[c] == cnt2[c], ok1 = ok1 or cnt1[c] > 1;
    if (ok and (ok1 or x == y))
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
