a,b,c,d,e,f,g = map(int,input().split()) g -= min(a, g//500)*500 g -= min(b, g//100)*100 g -= min(c, g//50)*50 g -= min(d, g//10)*10 g -= min(e, g//5)*5 if g <= f: print('YES') else: print('NO')