#include <bits/stdc++.h>
using namespace std;
long long n, k, a[55];
long long f[55][2555];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] -= k;
  }
  for (int i = 1; i <= n; i++) {
    int v = a[i];
    for (int j = -2500; j <= 2500; j++) f[i][j] += f[i - 1][j - v];
    for (int j = -2500; j <= 2500; j++) f[i][j] += f[i - 1][j];
    f[i][v]++;
  }
  cout << f[n][0];
}
