#include <bits/stdc++.h>
typedef long long ll;
#define InAHurry cin.tie(0)->sync_with_stdio(0);
using namespace std;
int main(){
InAHurry;
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
int t;
cin>>t;
while(t--) {
int n;
cin>>n;
string a,b;
cin>>a>>b;
sort(a.begin(), a.end());
sort(b.begin(), b.end());
if(a==b) cout<<"yes\n";
else cout<<"no\n";
}
return 0;
}