#include <bits/stdc++.h>
const int MOD = 1E9 + 7;
const int N = 50 + 5;
const int dx[] = {0, 0, -1, 1, -1, -1, 1, 1};
const int dy[] = {-1, 1, 0, 0, -1, 1, -1, 1};
using namespace std;
int x[N];
long long dp[N][N * N];
int main() {
  int n, a;
  scanf("%d%d", &n, &a);
  for (int i = 1; i <= n; i++) scanf("%d", &x[i]);
  dp[0][0] = 1;
  for (int k = 1; k <= n; k++) {
    for (int i = k - 1; i >= 0; i--) {
      for (int j = 0; j <= 50 * j; j++) {
        dp[i + 1][j + x[k]] += dp[i][j];
      }
    }
  }
  long long res = 0;
  for (int i = 1; i <= n; i++) {
    int val = i * a;
    res += dp[i][val];
  }
  printf("%lld\n", res);
  return 0;
}
