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