#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int N, A;
    cin>>N>>A;

    vector<vector<long long>> T(N+1, vector<long long>(50*N+1));
    T[0][0] = 1LL;

    for (int i=0; i<N; i++)
    {
        int x;
        cin>>x;

        vector<vector<long long>> P = T;

        for (int j=0; j<=i; j++)
        for (int k=0; k<=50*i; k++)
            T[j+1][k+x] += P[j][k];
    }
    long long ans = 0;
    for (int i=1; i<=N; i++)
        ans += T[i][i*A];
    cout<<ans<<endl;
}
