X = map(int,input().split(".")) Y = map(int,input().split(".")) if Y <= X: print("YES") else: print("NO")