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