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