i = tuple(map(int,input().split("."))) l = tuple(map(int,input().split("."))) print("YES" if i>=l else "NO")