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