fossil_version = int(input().replace('.', '')) target_version = int(input().replace('.', '')) if fossil_version > target_version: print('YES') else: print('NO')