n=[] for _ in range(2): a,b,c=map(int,input().split(".")) n.append(a*1000000+b*1000+c) if n[0]>=n[1]:print("YES") else:print("NO")