#![allow(unused_imports)]
#![allow(dead_code)]

use proconio::input;
use std::collections::*;

fn main() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());
    let n: usize = sc.read();
    let a: usize = sc.read();
    let x: Vec<usize> = sc.vec(n);
    let init = (0..n + 1)
        .map(|i| {
            (0..2501)
                .map(|j| if i == 0 && j == 0 { 1 } else { 0 })
                .collect()
        })
        .collect::<Vec<Vec<usize>>>();
    let dp = x.iter().fold(init, |acc, &x| {
        (0..n + 1)
            .map(|num_cards| {
                (0..2501)
                    .map(|sum| {
                        if num_cards == 0 || sum < x {
                            acc[num_cards][sum]
                        } else {
                            acc[num_cards][sum] + acc[num_cards - 1][sum - x]
                        }
                    })
                    .collect()
            })
            .collect::<Vec<Vec<usize>>>()
    });
    let mut ans = 0;
    for i in 1..n + 1 {
        for j in 0..2501 {
            if i * a == j {
                ans += dp[i][j];
            }
        }
    }
    println!("{}", ans);
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> IO<R, W> {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: ToString>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.to_string().as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}