#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL dp[55][5005];
int main(){
    int n, a, x;
    scanf("%d%d", &n, &a);
    dp[0][2500] = 1;
    for(int i=1;i<=n;i++){
        scanf("%d", &x);
        for(int j=0;j<=5000;j++) dp[i][j+x-a] += dp[i-1][j], dp[i][j] += dp[i-1][j];
    }
    printf("%lld\n", dp[n][2500]-1);
}