#include <bits/stdc++.h>
using namespace std;
long long mod = (1000000007LL);
inline long long mult(long long a, long long b) { return (a * b) % mod; }
inline long long poww(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
long long gcd(long long a, long long b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
long long n, m, q, k, v[300050], ans;
pair<long long, long long> w[300050];
string second;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  vector<long long> pos;
  for (long long i = 1; i <= n; i++) {
    cin >> v[i];
    if (v[i] > 1) pos.push_back(i);
  }
  pos.push_back(n + 1);
  long long LIM = (long long)(2e18);
  for (long long i = 1; i <= n; i++) {
    long long j = i;
    long long sum = v[i], prod = v[i];
    for (long long cnt = 0; cnt < 30; cnt++) {
      long long ant = j;
      auto it = upper_bound(begin(pos), end(pos), j);
      if (it == pos.end()) break;
      j = *it;
      if (prod % k == 0) {
        long long dh = prod / k - sum;
        if (0 <= dh and dh <= j - ant - 1) ans++;
      }
      if (v[j] > LIM / prod) break;
      prod *= v[j];
      sum += v[j] + (j - ant - 1);
    }
  }
  cout << ans << "\n";
}
