#include <bits/stdc++.h>
const long double eps = 1e-2;
const long double pi = acos(-1.0);
using namespace std;
const int N = 100;
int n, a;
vector<int> dp[N][N];
void solve() {
  cin >> n >> a;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    dp[i][1].push_back(x);
  }
  for (int sz = 2; sz <= n; sz++) {
    for (int i = sz; i <= n; i++) {
      for (int j = i - 1; j >= 1; j--) {
        for (int q = 0; q < dp[j][sz - 1].size(); q++)
          dp[i][sz].push_back(dp[j][sz - 1][q] + dp[i][1][0]);
      }
    }
  }
  int ans = 0;
  for (int sz = 1; sz <= n; sz++) {
    for (int i = 1; i <= n; i++) {
      for (int j = 0; j < dp[i][sz].size(); j++)
        if (dp[i][sz][j] == a * sz) ans++;
    }
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(NULL), cin.tie(0), cout.tie(0);
  cout.setf(ios::fixed), cout.precision(3);
  int step;
  step = 1;
  for (int i = 1; i <= step; i++) {
    solve();
  }
}
