#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int n, k;
int a[maxn];
int nxt[maxn];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", a + i);
    nxt[i] = a[i - 1] != 1 ? i - 1 : nxt[i - 1];
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    long long sum = 0, pro = 1;
    int r = i;
    while (r > 0 && pro <= 2e18 / a[r]) {
      int l = nxt[r];
      pro *= a[r];
      long long suml, sumr;
      sumr = sum + a[r];
      suml = sum + a[r] + r - 1 - l;
      if (pro % k == 0) {
        long long need = pro / k;
        if (sumr <= need && need <= suml) {
          ++ans;
        }
      }
      sum = suml;
      r = l;
    }
  }
  printf("%d\n", ans);
  return 0;
}
