#include <bits/stdc++.h>
using namespace std;
const long long big = 1000000007;
const long long mod = 998244353;
long long n, m, k, q, T;
unsigned long long verybig = 2e18 + 1;
vector<long long> A;
long long ones[200001] = {0};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long a, b, c, d;
  cin >> n >> k;
  for (int c1 = 0; c1 < n; c1++) {
    cin >> a;
    A.push_back(a);
  }
  a = 0;
  for (int c1 = n - 1; c1 >= 0; c1--) {
    if (A[c1] != 1) {
      a = 0;
    } else {
      a++;
    }
    ones[c1] = a;
  }
  long long ans = 0;
  for (int c1 = 0; c1 < n; c1++) {
    unsigned long long prod = 1;
    unsigned long long ksum = 0;
    long long c2 = c1;
    while (c2 < n) {
      if (A[c2] == 1) {
        long long diff = prod - ksum;
        if (diff > 0 && diff % k == 0 && diff / k <= ones[c2]) ans++;
        ksum += ones[c2] * k;
        c2 += ones[c2];
      } else {
        ksum += k * A[c2];
        long double logp = log2(prod);
        long double loga = log2(A[c2]);
        if (logp + loga >= 62.0) break;
        prod *= A[c2];
        if (ksum == prod) ans++;
        c2++;
      }
    }
  }
  cout << ans << "\n";
  return 0;
}
