#coding: UTF-8 import sys import re import itertools from math import log from collections import deque ### defs ### ### main ### v1 = list(map(int,sys.stdin.readline().split('.'))) v2 = list(map(int,sys.stdin.readline().split('.'))) v1 = v1[0]*1000000+v1[1]*1000+v1[2] v2 = v2[0]*1000000+v2[1]*1000+v2[2] if (v1>=v2): print('YES') else: print('NO')