#include <string>
#include <map>

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define Rep(i, sta, n) for (int i = sta; i < n; ++i)

using namespace std;
typedef long long ll;
const int mod = 1000000007;

ll dp[55][55][2555];

int main() {
    int N, A;
    cin >> N >> A;
    vector<int> x(N);
    rep(i, N) cin >> x[i];
    int sum = 0;
    rep(i, N) sum += x[i];

    dp[0][0][0] = 1;

    rep(j, N+1) {
        rep(k, N+1) {
            rep(l, sum+1) {
                if (j>=1 && k>=0 && l<x[j-1]) {
                    dp[j][k][l] = dp[j-1][k][l];
                }
                else if (j>=1 && k>=1 && l>=x[j-1]) {
                    dp[j][k][l] = dp[j-1][k][l] + dp[j-1][k-1][l-x[j-1]];
                }
                else if (j==0 && k==0 && l==0) dp[j][k][l] = 1;
                else dp[j][k][l] = 0;   
            }    
        }
    } 
    ll ans = 0;
   
    for (int k=1; A*k<=sum; k++) {
        ans += dp[N][k][A*k];
    }
    
    cout << ans << endl;
    return 0;
}
