#include <bits/stdc++.h>
using namespace std;
vector<long long int> vec;
vector<vector<long long int> > vec2;
long long int MOD = 1000000007;
long long int INF = 1145141919454519;
int main() {
  long long int N, A;
  cin >> N >> A;
  vector<long long int> card(N, 0);
  for (long long int i = 0; i < N; i++) {
    cin >> card[i];
  }
  vector<vector<vector<long long int> > > dp(
      199, vector<vector<long long int> >(199, vector<long long int>(3019, 0)));
  dp[0][0][0] = 1;
  long long int ans = 0;
  for (long long int i = 0; i < N; i++) {
    for (long long int num = 0; num <= N; num++) {
      for (long long int sum = 0; sum <= 3000; sum++) {
        if (dp[i][num][sum] == 0) continue;
        dp[i + 1][num][sum] += dp[i][num][sum];
        long long int tmp = dp[i][num][sum];
        long long int new_sum = sum + card[i];
        long long int new_num = num + 1;
        if (new_sum == new_num * A) {
          ans += tmp;
        }
        dp[i + 1][new_num][new_sum] += tmp;
      }
    }
  }
  cout << ans << endl;
}
