*A, G = map(int,input().split()) for i, V in zip(A, [500, 100, 50, 10, 5, 1]): G -= min(i, G // V) * V print("NO" if G else "YES")