#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A, x[60], dp[100][100][3000 + 10] = {0};
  cin >> N >> A;
  for (int i = 0; i < N; i++) {
    cin >> x[i];
  }
  dp[0][0][0] = 1;
  for (int i = 0; i < 100; i++) {
    dp[i][0][0] = 1;
  }
  for (int j = 1; j <= N; j++) {
    for (int k = 1; k <= j; k++) {
      for (int s = 1; s <= 3000; s++) {
        if (x[j - 1] > s) {
          dp[j][k][s] = dp[j - 1][k][s];
        } else {
          dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j - 1]];
        }
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= N; i++) {
    ans += dp[N][i][i * A];
  }
  cout << ans << endl;
}
