import java.util.Scanner; class main{ public static void main(String args[]){ Scanner scan = new Scanner(System.in); String str1 = scan.next(); String str2 = scan.next(); String ver1[] = str1.split("\\.", 0); String ver2[] = str2.split("\\.", 0); for(int i = 0; i < ver1.length; i++){ if(Integer.parseInt(ver1[i]) > Integer.parseInt(ver2[i])){ System.out.println("YES"); break; } else if(Integer.parseInt(ver1[i]) == Integer.parseInt(ver2[i])){ if(i == ver1.length - 1){ System.out.println("YES"); break; } continue; } else{ System.out.println("NO"); break; } } } }