#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a;
  cin >> n >> a;
  long long x[n];
  for (long long i = 0; i < (long long)n; i++) {
    cin >> x[i];
  }
  long long cnt[n][n][n * 50];
  for (long long i = 0; i < (long long)n; i++) {
    for (long long j = 0; j < (long long)n; j++) {
      for (long long k = 0; k < (long long)n * 50; k++) {
        if (i == 0) {
          if (j == 1 && k == x[i]) {
            cnt[i][j][k] = 1;
          } else {
            cnt[i][j][k] = 0;
          }
        } else {
          if (j == 0 || k < x[i]) {
            cnt[i][j][k] = 0;
          } else if (k < x[i]) {
            cnt[i][j][k] = cnt[i - 1][j - 1][k - x[i]] + cnt[i - 1][j][k];
          }
        }
      }
    }
  }
  long long ans = 0;
  for (long long i = 0; i < (long long)n; i++) {
    ans += cnt[n][i][a * i];
  }
  cout << ans << endl;
}
