#![allow(unused_imports)] use std::io; use std::str::FromStr; #[allow(non_snake_case)] fn main() { let V: Vec = read_array(); let N: i64 = V[0]; let A = V[1]; let X: Vec = read_array(); let mut sum: i64 = 0; for x in X { sum += x; } if sum == A * N { println!("YES"); } else{ println!("NO"); } } #[allow(dead_code, unused_must_use)] fn read() -> F { let mut line = String::new(); io::stdin().read_line(&mut line); match line.trim().to_string().parse::() { Ok(v) => v, Err(_) => panic!("Parse Error") } } #[allow(dead_code, unused_must_use)] fn read_array () -> Vec { let scan = io::stdin(); let mut line = String::new(); scan.read_line(&mut line).unwrap(); line.trim().to_string().split_whitespace().map( |x| match x.parse::(){ Ok(x) => x, Err(_) => panic!("Parse Error") } ).collect() }