v1 = tuple(map(int, input().split('.'))) v2 = tuple(map(int, input().split('.'))) print('YES' if v1 >= v2 else 'NO')