#include <bits/stdc++.h>
using namespace std;
const long long nax = 2 * (1e18);
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, k;
  cin >> n >> k;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
  }
  vector<long long> to(n);
  to.back() = n;
  for (long long i = n - 2; i >= 0; i--) {
    if (v[i + 1] != 1) {
      to[i] = i + 1;
    } else {
      to[i] = to[i + 1];
    }
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long r = i;
    long long p = v[i];
    long long s = v[i];
    if (p % k == 0 && p / k == s) {
      ans++;
    }
    while (p <= nax && p > 0 && to[r] < n) {
      if (numeric_limits<long long>::max() / v[to[r]] < p) break;
      p *= v[to[r]];
      s += v[to[r]] + to[r] - r - 1;
      r = to[r];
      if (p % k == 0 && p / k >= s && p / k <= s + (to[r] - r - 1)) {
        ans++;
      }
    }
  }
  cout << ans << endl;
}
