#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
const int INF = 1e9 + 1;
void docfile() {
  if (ifstream("FORM.inp")) {
    freopen("FORM.inp", "r", stdin);
    freopen("FORM.out", "w", stdout);
  } else if (ifstream("XAU7"
                      ".inp")) {
    freopen(
        "XAU7"
        ".inp",
        "r", stdin);
    freopen(
        "XAU7"
        ".out",
        "w", stdout);
  }
}
long long ans = 0, n, x, t, s[1000000], pos, pre;
int main() {
  docfile();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> x;
  long long a[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == x) ans++;
  }
  for (int i = 1; i <= n; i++) {
    for (int cnt = 1; cnt <= n - i + 1; cnt++) {
      for (int j = i + 1; j <= n - cnt + 1; j++) {
        t = 0;
        pre = j;
        for (int k = 1; k <= cnt; k++) {
          t += a[j];
          j++;
        }
        j = pre;
        s[++pos] = a[i] + t;
        if ((a[i] + t) / (1 + cnt) == x && (a[i] + t) % (1 + cnt) == 0) {
          ans++;
        }
      }
    }
  }
  if ((a[n - 1] + a[n]) / 2 == x && (a[n - 1] + a[n]) % 2 == 0) ans++;
  cout << ans;
}
