a,b,c = map(int,input().split(".")) x,y,z = map(int,input().split(".")) r1=100*100*a + 100*b + c r2=100*100*x + 100+y + z if r2<=r1: print("YES") else: print("NO")