#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
long long n, k, a[(int)2e5 + 100], pfs[(int)2e5 + 100];
bool OverFlow(long long x, long long y) {
  long long z = x * y;
  return !(z / x == y && z / y == x);
}
int main() {
  vector<pair<long long, long long> > v;
  v.push_back({0LL, 0LL});
  scanf("%I64d%I64d", &n, &k);
  for (long long i = 1; i < n + 1; i++) {
    scanf("%I64d", &a[i]);
    pfs[i] = pfs[i - 1] + a[i];
    if (a[i] > 1) v.push_back({(long long)i, a[i]});
  }
  v.push_back({(long long)n + 1, 1e15});
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    long long p = 1LL;
    for (int j = lower_bound(v.begin(), v.end(),
                             make_pair((long long)i, -1LL)) -
                 v.begin(),
             cnt = 0;
         j < v.size() && cnt <= 50; j++, cnt++) {
      if ((!cnt && j != i) || v[j].first != v[j - 1].first + 1)
        if (p % k == 0 && (p / k) > pfs[v[j - 1].first] - pfs[i - 1] &&
            (p / k) <
                pfs[v[j - 1].first] - pfs[i - 1] + v[j].first - v[j - 1].first)
          ans++;
      if (OverFlow(p, v[j].second)) break;
      p *= v[j].second;
      if (p > (long long)5e11) break;
      long long s = pfs[v[j].first] - pfs[i - 1];
      if (p % s == 0 && p / s == k) ans++;
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
