def main(): print('YES' if tuple(map(int, input().split('.'))) >= tuple(map(int, input().split('.'))) else 'NO') if __name__ == '__main__': main()