#include <bits/stdc++.h>
using namespace std;
const int N = 2510;
const int Y = 2500;
long long dp[N][N];
int n, x;
int a[N];
int main() {
  scanf("%d%d", &n, &x);
  dp[0][Y] = 1;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), a[i] -= x;
  for (int i = 1; i <= n; i++) {
    for (int j = -Y; j <= Y; j++) {
      dp[i][j + Y + a[i]] += dp[i - 1][j + Y];
      dp[i][j + Y] += dp[i - 1][j + Y];
    }
  }
  printf("%lld\n", dp[n][Y] - 1);
  return 0;
}
