*a,g = map(int,input().split()) for ai,v in zip(a,[500,100,50,10,5,1]): g -= min(ai,g//v)*v print("NO" if g else "YES")