f = input().replace('.','') s = input().replace('.','') if int(s) < int(f): print('YES') else: print('NO') print(f) print(s)