import java.util.Scanner;
class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count = 0;
		
		String str = sc.next();
		char[] array = str.toCharArray();
		for(char ch:array) {
			count += ch - 'a';
		}
		
		str = sc.next();
		char[] array2 = str.toCharArray();
		for(char ch:array2) {
			count -= ch - 'a';
		}
		
		if(count == 0) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}
}