a = tuple(map(int, input().split('.'))) b = tuple(map(int, input().split('.'))) print("YES" if a >= b else "NO")