#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const long long C = 2e18;
int n, k, a[N];
long long sum[N];
int go[N];
long long ans = 0;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    sum[i] = sum[i - 1] + a[i];
  }
  for (int i = n - 1; i >= 1; i--)
    if (a[i + 1] > 1)
      go[i] = i + 1;
    else
      go[i] = go[i + 1];
  for (int l = 1; l <= n; l++) {
    if (k == 1) ans++;
    int r = l;
    long long p = a[l];
    while (go[r] && a[go[r]] <= 1.0 * C / p) {
      p *= a[go[r]];
      r = go[r];
      if (p % k == 0) {
        long long want = p / k;
        long long s = sum[r] - sum[l - 1];
        long long tr = go[r] == 0 ? n + 1 : go[r];
        long long rest = sum[tr - 1] - sum[r];
        if (want >= s && want <= s + rest) ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
