/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	
 static	String equal( String s1,String s2)
	{
		//maps for odd and even parts of both s1,s2 strings
		Map<Character,Integer> m1=new HashMap<>();
		Map<Character,Integer> m2=new HashMap<>();
		Map<Character,Integer> m3=new HashMap<>();
		Map<Character,Integer> m4=new HashMap<>();
		
		//putting chars of s1 of both  odd and even idx in maps
		for(int i=0;i<s1.length();i++)
		{
			char ch=s1.charAt(i);
			
			//if idx is odd we will put character in map 1
			if(i%2!=0)
			m1.put(ch,m1.getOrDefault(ch,0)+1);
			
			//if idx is even we will put char in map 2
			else
			m2.put(ch,m2.getOrDefault(ch,0)+1);
		}
		
		//putting odd and even idx chars of s2 in map
		for(int i=0;i<s2.length();i++)
		{
			char ch=s2.charAt(i);
			//putting odd idx chars of s2 in map 3
			if(i%2!=0)
			m3.put(ch,m3.getOrDefault(ch,0)+1);
			
			//putting eve idx parts of s3 in map4
			else
			m4.put(ch,m4.getOrDefault(ch,0)+1);
			
		}
		
		boolean ans1,ans2;
		ans1=true;
		ans2=true;
		
		//checking odd idx chars in s1,s2
		for(char ch:m1.keySet())
		{
			if(m1.getOrDefault(ch,0)!=m3.getOrDefault(ch,0))
			{
				ans1=false;
				break;
			}
		}
		
		// checking eve idx chars in s1,s2
		for(char ch:m2.keySet())
		{
			if(m2.getOrDefault(ch,0)!=m4.getOrDefault(ch,0))
			{
				ans2=false;
				break;
			}
		}
		
		if(ans1==ans2)
		return "Yes";
		else
		return "No";
		
	}
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		List<String> l1=new ArrayList<>();
		List<String> l2=new ArrayList<>();
		
		//reading all string in a array
		for(int i=1;i<=n;i++)
		{
			String s=sc.next();
			l1.add(s);
		}
		
		//reading all strings of b array
		for(int i=1;i<=n;i++)
		{
			String s=sc.next();
			l2.add(s);
		}
		
		
		for(int i=0;i<n;i++)
		System.out.println(equal(l1.get(i),l2.get(i)));
	}
}
