#include <bits/stdc++.h>
using namespace std;
int N, A;
int x[50];
int dp[51][10000];
int main() {
  cin >> N >> A;
  for (int i = (0); i < (N); i++) {
    cin >> x[i];
  }
  for (int i = (0); i < (N); i++) {
    x[i] -= A;
  }
  for (int a = -2500; a <= 2500; a++) {
    dp[0][a + 5000] = 0;
  }
  dp[0][0 + 5000] = 1;
  for (int i = (0); i < (N); i++) {
    for (int a = -2500; a <= 2500; a++) {
      dp[i + 1][a + 5000] = dp[i][a + 5000] + dp[i][(a - x[i]) + 5000];
    }
  }
  cout << dp[N][0 + 5000] - 1 << endl;
}
