#include <bits/stdc++.h>
template <typename Arg1>
void ZZ(const char* name, Arg1&& arg1) {
  std::cout << name << " = " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void ZZ(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  std::cout.write(names, comma - names) << " = " << arg1;
  ZZ(comma, args...);
}
using namespace std;
long long int to_ll(string s) {
  long long int i, ret = 0, p = 1;
  for (i = (long long int)s.length() - 1; i >= 0; i--)
    ret += (s[i] - '0') * p, p *= 10LL;
  return ret;
}
long long int gcd(long long int x, long long int y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long int pwr(long long int base, long long int expo, long long int m) {
  if (base == 0) return 0LL;
  if (expo == 0) return (1LL % m);
  if ((expo & 1) == 0) {
    long long int temp = pwr(base, expo >> 1, m);
    return (temp * temp) % m;
  }
  return ((base % m) * pwr(base, expo - 1, m)) % m;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n, k;
  long long int mark = 1e18;
  mark *= 2;
  cin >> n >> k;
  vector<long long int> v(n), sl(n);
  vector<long long int> pref(n + 1);
  long long int i, j, sm = 0, last = -1;
  for (i = 0; i < n; i++) {
    cin >> v[i];
    sm += v[i];
    pref[i + 1] = sm;
    if (v[i] != 1) last = i;
    sl[i] = last;
  }
  long long int ans = 0;
  for (i = 0; i < n; i++) {
    long long int p = 1;
    j = i;
    while (j >= 0) {
      if (p > mark) break;
      if (v[j] == 1) {
        long long int lo = pref[i + 1] - pref[j];
        j = sl[j];
        long long int hi = pref[i + 1] - pref[j + 1];
        if (p >= lo * k && p <= hi * k && p % k == 0) ans++;
      } else {
        if (p > mark / v[j]) break;
        p = p * v[j];
        if (p == (pref[i + 1] - pref[j]) * k) ans++;
        j--;
      }
    }
  }
  cout << ans << "\n";
  return 0;
}
