#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;

#define int long long
int N, A;
int D[51][2501];

signed main() {
  cin >> N >> A;
  D[0][0] = 1;
  for (int i=0; i<N; i++) {
    int x;
    cin >> x;
    for (int j=i; j>=0; j--) {
      for (int k=0; k<=50*(j+1); k++) {
        D[j+1][k+x] += D[j][k];
      }
    }
  }
  int c = 0;
  for (int i=1; i<=N; i++) {
    c += D[i][i*A];
  }
  cout << c << "\n";
  return 0;
}
