#include <bits/stdc++.h>

const int max_N = 55;

using LL = long long;

int n, m;

LL dp[max_N][max_N * max_N];

int main() {
    scanf("%d%d", &n, &m);
    dp[0][0] = 1;
    for (int i = 1, a; i <= n; ++i) {
        scanf("%d", &a);
        for (int j = i; j; --j) {
            for (int k = a; k <= i * 50; ++k) {
                dp[j][k] += dp[j - 1][k - a];
            }
        }
    }
    LL ans = 0;
    for (int j = 1, k = 0; j <= n; ++j) {
        ans += dp[j][k += m];
    }
    printf("%lld\n", ans);
}