#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  vector<long long int> d(n);
  for (int i = 0; i < n; i++) {
    cin >> d[i];
  }
  vector<long long int> dd(2600, 0);
  for (long long int i = 0; i < n; i++) {
    vector<long long int> dd2(2600, 0);
    for (long long int j = 0; j < 2501; j++) {
      if (dd[j] > 0 && j + d[i] < 2501) {
        dd2[j] += dd[j];
        dd2[j + d[i]] += dd[j];
      }
    }
    dd2[d[i]]++;
    dd = dd2;
  }
  long long int cc = 0;
  for (int i = a; i < 2501; i += a) {
    cc += dd[i];
  }
  cout << cc << endl;
  return 0;
}
