#include <bits/stdc++.h>
using namespace std;
long long minimum(long long x, long long y) { return min(x, y); }
long long maximum(long long x, long long y) { return max(x, y); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long MAX = 9223372036854775807;
  long long test;
  long long mod = 998244353;
  test = 1;
  while (test--) {
    long long n, k;
    cin >> n >> k;
    vector<long long> a(n + 5);
    vector<long long> x;
    for (long long i = 0; i < n; i++) {
      cin >> a[i + 1];
      if (a[i + 1] > 1) x.push_back(i + 1);
    }
    long long ans = 0;
    for (int i = 1; i <= n; i++) {
      long long in = lower_bound(x.begin(), x.end(), i) - x.begin();
      long long sum = a[i];
      long long pr = 1;
      long long prev = i;
      while (in < x.size() && a[x[in]] <= (2 * 1e18 / pr)) {
        if (pr % k == 0 && x[in] != prev) {
          if (pr / k <= sum + x[in] - prev - 1 && pr / k >= sum) ans++;
        }
        pr *= a[x[in]];
        if (x[in] != prev) sum += a[x[in]] + x[in] - prev - 1;
        prev = x[in];
        in++;
      }
      if (pr % k == 0) {
        if (pr / k <= sum + n + 1 - prev - 1 && pr / k >= sum) ans++;
      }
    }
    cout << ans << endl;
  }
}
