n, a = gets.split.map(&:to_i) x = gets.split.map(&:to_i) ans = if n * a == x.inject(:+) "YES" else "NO" end puts ans