import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String s1 = scan.next(); String s2 = scan.next(); scan.close(); String []str1 = s1.split("[.]"); String []str2 = s2.split("[.]"); for(int i = 0; i < str1.length; i++) { int k1 = Integer.parseInt(str1[i]); int k2 = Integer.parseInt(str2[i]); if(k1 > k2) { System.out.println("YES"); System.exit(0); }else if(k1 < k2){ System.out.println("NO"); System.exit(0); } } System.out.println("YES"); } }