import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); char[] A = scan.next().toCharArray(); char[] B = scan.next().toCharArray(); int count = 0; for(int i = 0; i < A.length; i++){ for(int j = 0; j < B.length; j++){ if(A[i] == B[j]){ count++; break; } } } String result; result = count == A.length ? "YES":"NO"; System.out.println(result); scan.close(); } }