class Version { int[] num = new int[3]; } public class No_138 { public static void main(String[] args) { java.util.Scanner sc = new java.util.Scanner(System.in); String[] s1 = sc.nextLine().split("\\."); String[] s2 = sc.nextLine().split("\\."); String ans = "YES"; Version old = new Version(); Version set = new Version(); for (int i = 0; i < 3; i++) { old.num[i] = Integer.parseInt(s1[i]); set.num[i] = Integer.parseInt(s2[i]); if (old.num[i] < set.num[i]) { ans = "NO"; break; } } System.out.println(ans); sc.close(); } }