package P138; /* import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.AnchorPane; import javafx.stage.Stage; */ import java.io.*; import java.util.Arrays; import java.util.Scanner; public class P138 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String l = sc.next(); String[] lstrs = l.split("\\.",0); String n = sc.next(); String[] nstrs = n.split("\\.",0); int lint[] = new int[10]; int nint[] = new int[10]; for (int i=0;i<3;i++) { lint[i] = Integer.parseInt(lstrs[i]); nint[i] = Integer.parseInt(nstrs[i]); } if (lint[0] <= nint[0]) { if(lint[1] <= nint[1]) { if(lint[2] <= nint[2]) { System.out.println("YES"); } else { System.out.println("NO"); } } else { System.out.println("NO"); } } else { System.out.println("NO"); } } }