n = map(int,input().split(".")) m = map(int,input().split(".")) if sum(m)-sum(n)<0: print("YES") else: print("NO")