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