#include<cstdio>
#include <iostream>
typedef long long LL;
using namespace std;
LL dp[55][2501];
int now;
int main(){
    dp[0][0]=1;
    int n,m,k,t;
    int a;
    LL ans=0;
    cin>>n>>a;
    for (int i=1; i<=n; ++i) {
        scanf("%d",&k);
        now+=k;
        for (int j=i; j>=1; --j) {
            for (t=now; t>=k; --t) {
                dp[j][t]+=dp[j-1][t-k];
            }

        }
    }
    for (int i=1; i<=n; ++i)ans+=dp[i][a*i];
    printf("%lld\n",ans);
}
