n, m = read_line.split.map(&.to_i) x = read_line.split.map(&.to_i) t = [] of Int32 cards = Hash(Array(Int32), Array(Int32)).new { |h, k| h[k] = [] of Int32 } cs = Array.new(n) do |i| e = read_line.split.map(&.to_i) t << e[-1] cards[e[..-2].map { |v| v * t[-1] }] << i e[..-2] end z = Array.new(m, 0) n.times do |i| if t[i] == 100 if x == cs[i] puts "Yes" exit end next end ok = true m.times do |j| z[j] = 10000 * x[j] - 100 * t[i] * cs[i][j] if z[j] % (100 - t[i]) != 0 ok = false break else z[j] //= (100 - t[i]) end end next if !ok if !cards[z].select { |v| v != i }.empty? puts "Yes" exit end end puts "No"