#include<bits/stdc++.h>

using namespace std;

long long n, A, a[55], q[10005][55];

int main(){
    cin >> n >> A;
    for(long long i = 1; i <= n; i++){
        cin >> a[i];
        a[i] = a[i] - A;
    }
    for(long long j = 1; j <= n; j++){
        for(long long i = 0; i <= 6000; i++){
            long long tmp = i - a[j];
            if(tmp >= 0) q[i][j] = q[i][j - 1] + q[tmp][j - 1];
            if(i == a[j] + 2500) q[i][j] += 1;
        }
    }
    cout << q[2500][n];
}
