A,B,C=map(int,input().split(".")) a,b,c=map(int,input().split(".")) if A>=a and B>=b and C>=c: print("YES") else: print("NO")