#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int inf = 1e9 + 7;
int ans, dp[59][59][2508], a[100];
int main() {
  dp[0][0][0] = 1;
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= i; j++) {
      for (int k = 0; k < 2501; k++) {
        dp[i][j][k] += dp[i - 1][j][k];
        if (j > 0 && a[i] <= k) dp[i][j][k] += dp[i - 1][j - 1][k - a[i]];
      }
    }
  }
  for (int i = 1; i <= n; i++) ans += dp[n][i][m * i];
  cout << ans;
}
