#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int n, a;
    cin >> n >> a;
    int x[n];
    for (int i = 0; i < n; i++) {
        cin >> x[i];
    }
    int size = n * a + 1, dp[n + 1][size] = {}, result = 0;
    dp[0][0] = 1;
    for (int k = 0; k < n; k++) {
        for (int i = n; i >= 0; i--) {
            for (int j = size - 1; j >= x[k]; j--) {
                dp[i][j] += dp[i - 1][j - x[k]];
            }
        }
    }
    for (int i = 1; i <= n; i++) {
        result += dp[i][i * a];
    }
    cout << result;
    return 0;
}