s = list(map(int, input().split("."))) t = list(map(int, input().split("."))) print("YES" if s>=t else "NO")