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

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

fn main() {
    input! {
        n:usize,
        a:usize,
        x:[usize;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);
}