X = list(map(int,input().split(".")))
Y = list(map(int,input().split(".")))

if Y <= X:
	print("YES")
else:
	print("NO")