import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = 0, m = 0; String[] s = sc.next().split("\\."); for (int i = 0; i < 3; i++) { n *= 1000; n += Integer.parseInt(s[i]); } s = sc.next().split("\\."); for (int i = 0; i < 3; i++) { m *= 1000; m += Integer.parseInt(s[i]); } if (n < m) { System.out.println("NO"); } else { System.out.println("YES"); } } }