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