#include <bits/stdc++.h>
using namespace std;

long long dp[52][2600];
int main() {
    int n, a;
    cin >> n >> a;
    dp[0][0] = 1;
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        for (int j = i; j >= 0; --j) {
            for (int k = 2550; k >= x; --k) {
                dp[j + 1][k] += dp[j][k - x];
            }
        }
    }
    long long ans = 0;
    for (int i = 1; i <= n; ++i) {
        ans += dp[i][i * a];
    }
    cout << ans << "\n";
    return 0;
}
