import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); List A = new ArrayList<>(Arrays.asList(sc.next().split(""))); List B = new ArrayList<>(Arrays.asList(sc.next().split(""))); A.removeAll(B); B.removeAll(A); System.out.println((A.size() == 0 && B.size() == 0)? "YES" : "NO"); } }