A, B, C, D, E, F, G = gets.split.map &:to_i (0..A).each{|a| (0..B).each{|b| (0..C).each{|c| (0..D).each{|d| (0..E).each{|e| f = G - (500 * a + 100 * b + 50 * c + 10 * d + 5 * e) if f.between?(0, F) puts :YES exit end } } } } } puts :NO