#include <bits/stdc++.h>
using namespace std;
const int N = 52;
long long n, target, ans, x[N], dp[N][N][N * N];
int main() {
  cin >> n >> target;
  for (long long i = 1; i <= n; i++) cin >> x[i];
  for (long long i = 0; i <= n; i++) dp[i][0][0] = 1;
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= i; j++)
      for (long long s = 0; s <= n * target; s++) {
        if (x[i] <= s)
          dp[i][j][s] = dp[i - 1][j][s] + dp[i - 1][j - 1][s - x[i]];
      }
  for (long long i = 1; i <= n; i++) ans += dp[n][i][i * target];
  cout << ans;
}
