#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long g = gcd(a, b);
  return a / g * b;
}
long long factorial(long long n) {
  long long t = 1;
  for (long long(i) = 1; (i) <= (n); ++(i)) t *= i;
  return t;
}
long long combinations(long long n, long long k) {
  long long r = 1;
  for (long long d = 1; d <= k; ++d) {
    r *= n--;
    r /= d;
  }
  return r;
}
int main() {
  long long n, a, x;
  cin >> n >> a;
  vector<long long> cnt(205, 0);
  for (long long(i) = 0; (i) < (n); ++(i)) {
    cin >> x;
    x -= a;
    if (x < 0) {
      for (long long(j) = 0; (j) < (101); ++(j)) {
        if (cnt[j] != 0) cnt[j + x] += cnt[j];
      }
    } else {
      for (long long(j) = (101) - 1; (j) >= 0; --(j)) {
        if (cnt[j] != 0) cnt[j + x] += cnt[j];
      }
    }
    ++cnt[x + 50];
  }
  cout << cnt[50] << endl;
  return 0;
}
