n = list(map(int, input().split('.'))) v = list(map(int, input().split('.'))) if n[0] >= v[0] and n[1] >= v[1] and n[2] >= v[2]: print('YES') else: print('NO')