import java.util.Scanner; public class Main{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); while(sc.hasNext()){ String[] s1=(sc.next()).split("."); String[] s2=(sc.next()).split("."); int n=Integer.parseInt(s1[0]+s1[1]+s1[2]); int o=Integer.parseInt(s2[0]+s2[1]+s2[2]); if(n>o) System.out.println("YES"); else System.out.println("NO"); } } }