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