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