X = list(map(int, input().split('.'))) Y = list(map(int, input().split('.'))) print('NO' if X < Y else 'YES')