#include <bits/stdc++.h>
using namespace std;
long long t, n;
long long a[51];
long long f[51][2501];
int32_t main() {
  cin >> n >> t;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  long long res = 0;
  long long sum = 0;
  f[0][0] = 1;
  for (long long i = 1; i <= n; i++)
    for (long long j = i; j > 0; j--) {
      for (long long k = 2500; k >= a[i]; k--) {
        f[j][k] += f[j - 1][k - a[i]];
      }
    }
  for (long long i = 1; i <= n; i++) {
    res += f[i][t * i];
  }
  cout << res;
}
