X = [int(x) for x in input().split('.')] Y = [int(x) for x in input().split('.')] if X < Y: print('NO') else: print('YES')