#include <bits/stdc++.h>
using namespace std;
long long n, k, ans;
long long a[200005], nxt[200005];
int main() {
  scanf("%I64d%I64d", &n, &k);
  for (long long(i) = (1); (i) <= (n); (i)++) scanf("%I64d", &a[i]);
  nxt[n] = n + 1;
  for (long long(i) = (n - 1); (i) >= (1); (i)--)
    if (a[i + 1] != 1)
      nxt[i] = i + 1;
    else
      nxt[i] = nxt[i + 1];
  for (long long(i) = (1); (i) <= (n); (i)++) {
    long long now = i, pro = 1ll, sum = 0ll, prev = i - 1;
    while (now != n + 1 && pro <= (1000000000000000000LL / a[now])) {
      pro *= a[now];
      sum = sum + a[now] + now - prev - 1;
      if (pro % k == 0 && pro / k - sum <= nxt[now] - now - 1 &&
          pro / k - sum >= 0) {
        ans++;
      }
      prev = now;
      now = nxt[now];
    }
  }
  printf("%I64d", ans);
}
