#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back 
#define pf push_front 
#define mp make_pair
#define fr first
#define sc second
#define Rep(i,n) for(int i=0;i<(n);i++)
#define All(v) v.begin(),v.end()
typedef pair<int, int> Pii; typedef pair<int, Pii> Pip;
const int INF = 1107110711071107;

int N, A;
int x[51];
int dp[51][51][51];

int func( int n, int cnt, int sum ) {
  //cout << n << " " << sum << endl;
  if( n == N && cnt != 0 && (double)((double)sum / (double)cnt) == (double)A ) return 1;
  if( n == N ) return 0;
  if( dp[n][cnt][sum] != -1 ) return dp[n][cnt][sum];

  int ret = func( n+1, cnt+1, sum+x[n] ) + func( n+1, cnt, sum );
  return dp[n][cnt][sum] = ret;
}

main()
{
  fill_n( **dp, 51*51*51, -1);
  cin >> N >> A;
  Rep(i, N) cin >> x[i];

  cout << func( 0, 0, 0 ) << endl;
}
