a,b,c=map(str,input().split(".")) x,y,z=map(str,input().split(".")) s=int(a+b+c) t=int(x+y+z) if s>=t:print("YES") elif s