#include <bits/stdc++.h>
using namespace std;
long long ans = 0;
int a[200005];
int r[200005];
int main() {
  int n;
  long long k;
  scanf("%d%lld", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int pre = n + 1;
  for (int i = n; i >= 1; i--) {
    r[i] = pre;
    if (a[i] > 1) pre = i;
  }
  for (int i = 1; i <= n; i++) {
    long long p = 1;
    long long s = 0;
    for (int j = i; j <= n; j = r[j]) {
      if (1ll * a[j] > 2e18 / p) break;
      p *= 1ll * a[j];
      s += 1ll * k * (a[j]);
      if (p == s) {
        ans++;
      } else if (p > s) {
        if ((p - s) % k == 0 && (p - s) / k <= r[j] - j - 1) {
          ans++;
        }
      }
      s += 1ll * k * (r[j] - j - 1);
    }
  }
  printf("%lld\n", ans);
  return 0;
}
