#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
long long n, k, a[1000010], nxt[1000010];
int main() {
  cin >> n >> k;
  long long x = n + 1, ans = 0;
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (int i = n; i >= 1; i--) {
    nxt[i] = x;
    if (a[i] != 1) x = i;
  }
  for (int i = 1; i <= n; i++) {
    int j = i;
    long long s = 0, p = 1;
    while (j <= n) {
      if (p > 9223372036854775807 / a[j]) break;
      p *= a[j], s += a[j];
      long long len = nxt[j] - j - 1;
      if (p % k == 0 && s <= p / k && p / k <= (s + len)) ans++;
      s += len, j = nxt[j];
    }
  }
  printf("%lld\n", ans);
  return 0;
}
