#include <bits/stdc++.h>
using namespace std;
const long long LINF = 2e18 + 5;
const int N = 2e5 + 5;
int n, k, a[N];
int nex[N];
long long ans;
long long mul(long long a, long long b) {
  if (a > LINF / b) return LINF;
  return a * b;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = n; i >= 1; i--) {
    if (a[i + 1] == 1)
      nex[i] = nex[i + 1];
    else
      nex[i] = i + 1;
  }
  for (int i = 1; i <= n; i++) {
    long long prod = a[i];
    long long sum = a[i];
    if (prod == k * sum) ans++;
    int j = i;
    while (j <= n and prod < LINF) {
      int tot1 = nex[j] - j - 1;
      if (tot1) {
        if (prod % k == 0 and k * sum < prod and k * (sum + tot1) >= prod)
          ans++;
        sum += tot1;
      }
      j = nex[j];
      if (j > n) break;
      prod = mul(prod, a[j]);
      sum += a[j];
      if (prod == k * sum) ans++;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
