use std::io;
use std::cmp;
use std::collections::BinaryHeap;
use std::collections::HashMap;
use std::collections::HashSet;
use std::f64::consts::PI;

fn read_line() -> String {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).ok();
    buf
}


fn main() {
    let line: Vec<i32> = read_line().split_whitespace().map(|s| s.parse().unwrap()).collect();
    let n = line[0] as usize;
    let a = line[1];
    let mut xs: Vec<i32> = read_line().split_whitespace().map(|s| s.parse().unwrap()).collect();
    for i in 0..n {
        xs[i] -= a;
    }

    let mut memo = HashMap::new();
    memo.insert(0, 1u64);

    for i in 0..n {
        let tmp = memo.clone();
        for (&key, &val) in tmp.iter() {
            memo.insert(key + xs[i], memo.get(&(key + xs[i])).unwrap_or(&0) + val);
        }

    }

    println!("{}", memo.get(&0).unwrap() - 1);
}
