#include <bits/stdc++.h>
using namespace std;
long long a[2590][55] = {0};
int main() {
  long long n, A, i, j, k, ans = 0;
  a[0][0] = 1;
  cin >> n >> A;
  for (k = 0; k < n; k++) {
    int tmp;
    cin >> tmp;
    for (i = 2550; i >= 0; i--)
      for (j = 0; j < n; j++) {
        if (a[i][j]) a[i + tmp][j + 1] += a[i][j];
      }
  }
  for (i = A; i < 2550; i = i + A) {
    long long mn = 12365478914774166;
    for (j = 0; j < 51; j++) {
      if (a[i][j] == 0) continue;
      mn = min(mn, a[i][j]);
    }
    if (mn != 12365478914774166) ans += mn;
  }
  cout << ans << endl;
  return 0;
}
