#include <bits/stdc++.h>
int a[200007], n, k;
int x[200007];
int cat(int i) {
  int j, r;
  long long p, s;
  p = 1;
  s = 0;
  r = 0;
  for (j = i; j != -1; j = x[j]) {
    if (1e18 / p <= a[j]) {
      return r;
    }
    p *= a[j];
    s += a[j];
    if (p % k == 0) {
      if (p / k - s >= 0) {
        if (j - x[j] - 1 >= p / k - s) {
          r++;
        }
      }
    }
    s += j - x[j] - 1;
  }
  return r;
}
void run() {
  int i, j;
  long long r;
  while (scanf("%d%d", &n, &k) != EOF) {
    for (i = 0; i < n; i++) {
      scanf("%d", &a[i]);
    }
    for (i = 0; i < n; i++) {
      x[i] = -1;
    }
    j = -1;
    for (i = 0; i <= n; i++) {
      x[i] = j;
      if (a[i] > 1) {
        j = i;
      }
    }
    r = 0;
    for (i = 0; i < n; i++) {
      r += cat(i);
    }
    printf(
        "%lld"
        "\n",
        r);
  }
}
int main() {
  run();
  return 0;
}
