#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const long long inf = 2e18;
int n, k, a[maxn], f[maxn];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  f[n] = n + 1;
  for (int i = n - 1; i; i--) f[i] = a[i + 1] == 1 ? f[i + 1] : i + 1;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    int r = i;
    long long sum = a[i], mul = a[i];
    while ((f[r] ^ (n + 1)) && a[f[r]] <= inf / mul) {
      sum += f[r] - r - 1 + a[f[r]];
      mul *= a[f[r]];
      r = f[r];
      long long ti = mul % k ? -1 : mul / k;
      ans += (sum <= ti && sum + f[r] - r - 1 >= ti);
    }
  }
  printf("%lld\n", ans + (k == 1) * n);
  return 0;
}
