#include <bits/stdc++.h>
using namespace std;
string s;
long long n, m, k, a[200005], b[200005];
long long ans = 0;
void input() {
  cin >> n >> k;
  for (long long i = 0; i < n; i++) cin >> a[i];
  return;
}
void solve() {
  long long Max = 1e18;
  b[n] = n + 1;
  b[n - 1] = n;
  for (long long i = n - 2; i >= 0; --i) {
    if (a[i + 1] != 1)
      b[i] = i + 1;
    else
      b[i] = b[i + 1];
  }
  for (long long i = 0; i < n; i++) {
    long long j = i;
    long long t = 1;
    long long sum = 0;
    while (j != n && a[j] <= Max / t) {
      long long u = 0;
      t *= a[j];
      sum += a[j];
      if (t % k == 0) u = t / k;
      if (sum <= u && u - sum <= b[j] - j - 1) ans++;
      sum += b[j] - j - 1;
      j = b[j];
    }
  }
  return;
}
void output() {
  cout << ans;
  return;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  {
    input();
    solve();
    output();
  }
  return 0;
}
