#include <bits/stdc++.h>
using namespace std;
const long long MAX_VAL = 100000000;
const long long MAX_PROD_VAL = 4000000000000000000;
bool product_too_large(double a, double b) {
  return a * b > (double)MAX_PROD_VAL;
}
bool try_binsearch(long long l, long long r, long long st, long long prod,
                   long long sum, long long k) {
  while (r - l > 1) {
    long long m = (l + r) / 2;
    if (prod <= k * (sum + m - st)) {
      r = m;
    } else {
      l = m + 1;
    }
  }
  return (prod == k * (sum + r - st)) || (prod == k * (sum + l - st));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  long long k;
  cin >> n >> k;
  vector<long long> a(n);
  for (auto &e : a) {
    cin >> e;
  }
  vector<int> next_mul(n);
  int last_mul = n;
  for (int i = n - 1; i >= 0; --i) {
    next_mul[i] = last_mul;
    if (a[i] > 1) {
      last_mul = i;
    }
  }
  int ans = 0;
  for (int st = 0; st < n; ++st) {
    long long prod = a[st];
    long long sum = a[st];
    long long l = st;
    long long r = st;
    while (r < n) {
      r = next_mul[r] - 1;
      if (l <= r && prod <= k * (sum + r - l)) {
        if (try_binsearch(l, r, l, prod, sum, k)) {
          ++ans;
        }
      }
      sum += r - l;
      ++r;
      if (r < n) {
        if (product_too_large(prod, a[r])) {
          break;
        }
        prod *= a[r];
        sum += a[r];
      }
      l = r;
    }
  }
  cout << ans << endl;
  return 0;
}
