a = input().split(".") b = input().split(".") print("YES" if a >= b else "NO")