import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines V1 = list(map(int,readline().split(b'.'))) V2 = list(map(int,readline().split(b'.'))) answer = 'YES' if V1 >= V2 else 'NO' print(answer)