#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
long long int a[maxn];
long long int suffix[maxn];
const long long int max_product = 1e18 + 1000;
int main() {
  long long int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  suffix[n - 1] = n;
  for (int i = n - 2; i >= 0; i--) {
    if (a[i + 1] != 1)
      suffix[i] = i + 1;
    else
      suffix[i] = suffix[i + 1];
  }
  long long int ans = 0;
  for (int l = 0; l < n; l++) {
    long long int r = l;
    ans += (k == 1);
    long long int f = a[l], s = a[l];
    while (suffix[r] != n && a[suffix[r]] <= (max_product / f)) {
      f *= a[suffix[r]];
      s += suffix[r] - r - 1 + a[suffix[r]];
      r = suffix[r];
      long long int want = -1;
      if (0 == f % k) want = f / k;
      long long int have = suffix[r] - r - 1;
      ans += (s <= want && want <= s + have);
    }
  }
  cout << ans << "\n";
  return 0;
}
