#include <bits/stdc++.h>
using namespace std;
const int N = 55;
int n, A;
long long F[N*N][N] = {0};

int main() {
    cin >> n >> A;
    F[0][0] = 1;
    for (int i = 1; i <= n; i++) {
        int x; cin >> x;
        for (int j = 2500; j >= x; j--) {
            for (int k = n; k >= 1; k--)
            if (F[j-x][k-1]) F[j][k] += F[j-x][k-1];
        }
    }
    long long res = 0;
    for (int i = 1; i <= n; i++) {
        int j = i*A;
        res += F[j][i];
    }
    cout << res << endl;
}
