// reference: https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

use std::cmp::Ordering;
#[derive(Eq, PartialEq, Clone, Debug)]
pub struct Rev<T>(pub T);

impl<T: PartialOrd> PartialOrd for Rev<T> {
    fn partial_cmp(&self, other: &Rev<T>) -> Option<Ordering> {
        other.0.partial_cmp(&self.0)
    }
}

impl<T: Ord> Ord for Rev<T> {
    fn cmp(&self, other: &Rev<T>) -> Ordering {
        other.0.cmp(&self.0)
    }
}

impl<T: Copy> Copy for Rev<T> {}

use std::collections::BinaryHeap;

fn main() {
    input! {
        n: usize,
        a: usize,
        x: [usize; n]
    }

    let max_sum = n * *x.iter().max().unwrap();
    let mut dp = vec![vec![vec![0i64; max_sum + 1]; n + 1]; n + 1];
    // [[0,p]枚までに][q枚使って][rになる選び方]は何通りあるか

    for p in 0..n + 1 {
        dp[p][0][0] = 1;
    }

    for p in 1..n + 1 {
        for q in 1..n + 1 {
            for r in 0..max_sum + 1 {
                dp[p][q][r] = dp[p - 1][q][r]
                    + if r >= x[p - 1] {
                        dp[p - 1][q - 1][r - x[p - 1]]
                    } else {
                        0
                    };
            }
        }
    }

    let mut ans = 0;
    for q in 1..n + 1 {
        ans += dp[n][q][a * q];
    }

    println!("{}", ans);
}
