a = list(map(int, input().split('.'))) b = list(map(int, input().split('.'))) if b <= a: print('YES') else: print('NO')