q = 1 q = int(input()) for _ in range(q): s = input() t = input() n = len(s) cou = [0]*26 for i in s: cou[ord(i) - ord('a')] += 1 for i in t: cou[ord(i) - ord('a')] -= 1 tf = False for i in range(26): if cou[i]: tf = True break if n%2: c1 = [0]*26 c2 = [0]*26 for i in range(n): if i%2 == 0: c1[ord(s[i]) - ord('a')] += 1 c1[ord(t[i]) - ord('a')] -= 1 else: c2[ord(s[i]) - ord('a')] += 1 c2[ord(t[i]) - ord('a')] -= 1 for i in range(26): if c1[i]: tf = True break if c2[i]: tf = True break else: c = [0]*676 for i in range(0,n,2): c11 = ord(s[i]) - ord('a') c12 = ord(s[i+1]) - ord('a') c21 = ord(t[i]) - ord('a') c22 = ord(t[i+1]) - ord('a') c[c11*26+c12] += 1 c[c21*26+c22] -= 1 for i in c: if i: tf = True break if tf: print("No") else: print("Yes")