#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A, x[50];
  cin >> N >> A;
  for (int i = 0; i < N; i++) {
    cin >> x[i];
  }
  long long dp[51][2501] = {{}};
  dp[0][0] = 1;
  for (int i = 0; i < N; i++) {
    for (int k = N; k >= 0; k--) {
      for (int j = 2500; j >= x[i]; j--) {
        dp[k][j] += dp[k - 1][j - x[i]];
      }
    }
  }
  int sub = 0;
  long long ret = 0;
  for (int i = 1; i <= N; i++) {
    sub += A;
    ret += dp[i][sub];
  }
  cout << ret << endl;
}
