#include <cstdio>
#define rep(i,m,n) for(i=m;i<=n;i++)
#define ll long long
using namespace std;
int n, m, k, t;
ll dp[51][2501];
int a, now;
ll ans;
int main()
{
    int i, j;
    dp[0][0] = 1;
    scanf("%d%d", &n, &a);
    for(i=1;i<=n;i++)
    {
        scanf("%d", &k);
        now += k;
        for (j = i; j >= 1; j--)
            for (t = now; t >= k; t--)
                dp[j][t] += dp[j - 1][t - k];
    }
    for(i = 1; i <= n;i++)
        ans += dp[i][a * i];
    printf("%lld\n", ans);
    return 0;
}
