#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char c = getchar();
  long long num = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    num = num * 10 + c - '0';
    c = getchar();
  }
  return num * f;
}
long long n, k, ans, a[200005], ne[200005];
int main() {
  n = read();
  k = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  int cnt = n + 1;
  ans = 0;
  for (int i = n; i >= 1; i--) {
    if (a[i] != 1) cnt = i;
    ne[i] = cnt;
  }
  for (int i = 1; i <= n; i++) {
    long long prod = 1, sum = 0;
    cnt = 0;
    for (int j = i; j <= n && cnt < 70; j++) {
      if (log10(prod) + log10(a[j]) >= 18) break;
      if (a[j] == 1) {
        if (prod % k == 0) {
          int tmp = ne[j] - j;
          long long div = prod / k;
          if (div - sum <= tmp && div > sum) ans++;
        }
        sum += ne[j] - j;
        j = ne[j] - 1;
        continue;
      }
      prod *= a[j], sum += a[j], cnt++;
      if (prod % k == 0 && prod / k == sum) ans++;
    }
  }
  printf("%I64d", ans);
  return 0;
}
