#include <iostream>

using namespace std;

#define ll long long

ll d[51][2501];

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

    d[0][0] = 1;
    for (int i = 1; i <= n; i++) {
        int x;
        cin >> x;

        for (int j = i - 1; j >= 0; j--)
            for (int s = 0; s <= j * 50; s++)
                d[j + 1][s + x] += d[j][s];
    }

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

    cout << ans;

    return 0;
}
