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