import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class No69 { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); char[] chrA = br.readLine().toCharArray(); //一文字ずつ分割して配列に入れる char[] chrB = br.readLine().toCharArray(); Arrays.sort(chrA); //アルファベットをソートする Arrays.sort(chrB); int count = 0; for (int i = 0; i < chrA.length; i++){ if(Arrays.equals(chrA, chrB)) count++; //配列の一致確認はArrays.equals(x,y) } if (count == chrA.length) System.out.println("YES"); //全部一致ならYES else System.out.println("NO"); } }