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