a#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

ll n, a, x[50] = {}, dp[51][51][2501] = {};

int main() {
  cin >> n >> a;
  for(int i = 0;i < n;i++){
      cin >> x[i];
  }
  dp[0][0][0] = 1;
  for(int i = 0;i < n;i++){
      for(int j = 0;j < n;j++){
          for(int k = 0;k <= 2500;k++){
              dp[i+1][j][k] += dp[i][j][k];
              if(k-x[i] >= 0)dp[i+1][j+1][k] += dp[i][j][k-x[i]];
          }
      }
  }
  ll ans = 0;
  for(int i = 1;i <= n && i*a <= 2500;i++){
      ans += dp[n][i][i*a];
  }
  cout << ans << endl;
}
