#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

int main()
{
    int N, A;
    int X[55];
    ll dp[55][5500] = {};

    cin >> N >> A;

    dp[0][2600] = 1;

    for(int i = 0; i < N; i++) {
        cin >> X[i]; X[i] -= A;
    }

    for(int i = 0; i < N; i++) {
        for(int j = 0; j <= 5400; j++) {
            dp[i + 1][j + X[i]] += dp[i][j];
            dp[i + 1][j] += dp[i][j];
        }
    }

    cout << dp[N][2600] - 1 << endl;


    return (0);
}
