#include <bits/stdc++.h>
using namespace std;
long long int n, a;
int x[51];
long long int num[51][51][2510];
long long int solve(long long int restsum, long long int restcardnum,
                    int selectcardnum) {
  if (restcardnum == 0 && restsum == 0) {
    num[selectcardnum][restcardnum][restsum] = 1;
    return 1;
  }
  if (num[selectcardnum][restcardnum][restsum] != -1)
    return num[selectcardnum][restcardnum][restsum];
  long long int result = 0;
  for (int i = selectcardnum; i <= n; i++) {
    if (restcardnum > 0 && restsum >= x[i])
      result += solve(restsum - x[i], restcardnum - 1, i + 1);
  }
  num[selectcardnum][restcardnum][restsum] = result;
  return result;
}
int main() {
  cin >> n >> a;
  long long int xsum = 0;
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
    xsum += x[i];
  }
  for (int i = 0; i < 51; i++) {
    for (int j = 0; j < 51; j++) {
      for (int k = 0; k < 2501; k++) {
        num[i][j][k] = -1;
      }
    }
  }
  long long int ans = 0;
  long long int nownum = a;
  long long int nowcardnum = 1;
  while (nowcardnum <= n && nownum <= xsum) {
    ans += solve(nownum, nowcardnum, 1);
    nownum += a;
    nowcardnum++;
  }
  cout << ans << endl;
  return 0;
}
