#include <bits/stdc++.h>
using namespace std;
long long n;
long long f[2501][51];
long long g[2501][51];
long long a[101];
long long sum;
long long dem;
long long B;
long long res;
void input() {
  cin >> n >> B;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
}
void solve() {
  res = 0;
  g[0][0] = 1;
  for (long long i = 1; i <= n; i++) {
    for (long long tong = 0; tong <= n * 50; tong++) {
      for (long long sl = 0; sl <= n; sl++) {
        f[tong + a[i]][sl + 1] += g[tong][sl];
        f[tong][sl] += g[tong][sl];
      }
    }
    for (long long tong = 0; tong <= n * 50; tong++) {
      for (long long sl = 0; sl <= n; sl++) {
        g[tong][sl] = f[tong][sl];
        f[tong][sl] = 0;
      }
    }
  }
  for (long long tong = B, sl = 1; tong <= n * 50; tong += B, ++sl) {
    res += g[tong][sl];
  }
}
void output() { cout << res; }
signed main() {
  input();
  solve();
  output();
  return 0;
}
