#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 1000;
long long a[N], k, n;
int fa[N];
int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
inline bool ck(long long f1, long long f2) {
  volatile long long c = f1 * f2;
  return c / f2 != f1;
}
long long solve(int x) {
  long long c1 = 1, c2 = 0;
  long long res = 0;
  for (int i = x; i <= n; i++) {
    if (ck(c1, a[i])) return res;
    int fx = find(i);
    if (a[i] > 1) {
      c1 = c1 * a[i];
      c2 += a[i];
      if (c1 % c2 == 0 && c1 / c2 == k) res++;
    } else {
      if (c1 % k == 0 && c2 + 1 <= c1 / k && c1 / k <= c2 + fx - i) res++;
      c2 += fx - i;
      i = fx - 1;
    }
  }
  return res;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n + 1; i++) fa[i] = i;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    if (a[i] == 1) fa[find(i)] = find(i + 1);
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += solve(i);
  }
  cout << ans << '\n';
}
