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