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