#include <iostream>

using namespace std;

int64_t d[55][2510] = {1};

int main()
{
    int n, a;
    cin >> n >> a;

    for (int x, i = 1; i <= n; ++i) {
        cin >> x;
        for (int j = i; j; --j)
            for (int k = 0; k <= (j - 1) * 50; ++k)
                d[j][k+x] += d[j-1][k];
    }

    int64_t res = 0;

    for (int i = 1; i <= n; ++i)
        res += d[i][a * i];

    cout << res;
    return 0;
}
