#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-14;
const double PI = acos(-1.0);
long long dp[51][51][2501];
int main() {
  int n, a;
  cin >> n >> a;
  for (int i = (int)(0); i < (int)(51); i++)
    for (int j = (int)(0); j < (int)(51); j++)
      for (int k = (int)(0); k < (int)(2501); k++) dp[i][j][k] = 0;
  vector<int> v(n);
  v[0] = 0;
  for (int i = (int)(1); i < (int)(n + 1); i++) {
    cin >> v[i];
    for (int x = (int)(i); x < (int)(n + 1); x++) dp[x][1][v[i]]++;
  }
  for (int i = (int)(1); i < (int)(n + 1); i++) {
    for (int j = (int)(2); j < (int)(n + 1); j++) {
      for (int k = (int)(0); k < (int)(2501); k++) {
        dp[i][j][k] = dp[i - 1][j][k];
        if (k - v[i] >= 0 && dp[i - 1][j - 1][k - v[i]] > 0) {
          dp[i][j][k] += dp[i - 1][j - 1][k - v[i]];
        }
      }
    }
  }
  long long ans = 0;
  for (int j = (int)(0); j < (int)(n + 1); j++) {
    for (int k = (int)(0); k < (int)(2501); k++) {
      if (j * a == k) {
        ans += dp[n][j][k];
      }
    }
  }
  cout << ans << endl;
}
