#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <cctype>
using namespace std;
int main()
{
int t;
cin >> t;
getchar();
while(t--) {
string a,b;
getline(cin,a);
getline(cin,b);
int c[26]={0};
int d[26]={0};
for (int i=0;i<a.size();i++) {
if (a[i] >= 'a' && a[i] <= 'z') {
c[a[i]-'a']++;
}
}
for (int i=0;i<b.size();i++) {
if (b[i] >= 'a' && b[i] <= 'z') {
d[b[i]-'a']++;
}
}
int flag = 1;
for (int i=0;i<26;i++) {
if (c[i] != d[i]) {
flag = 0;
}
}
if (flag)
cout << "Yes\n";
else
cout << "No\n";
}
}