#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const long long int INF = 1e18;
bool check(long long int sum, long long int prod, long long int len,
           long long int k) {
  long long int temp = prod - sum * k;
  if (temp % k != 0) return false;
  if (temp / k >= 0 && temp / k <= len) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, k, a[200100], nxt[200100], ans = 0;
  cin >> n >> k;
  for (__typeof(n + 1) i = (1) - ((1) > (n + 1));
       i != (n + 1) - ((1) > (n + 1)); i += 1 - 2 * ((1) > (n + 1)))
    cin >> a[i];
  long long int pos = n + 1;
  for (__typeof(1) i = (n + 1) - ((n + 1) > (1)); i != (1) - ((n + 1) > (1));
       i += 1 - 2 * ((n + 1) > (1))) {
    nxt[i] = pos;
    if (a[i] != 1) pos = i;
  }
  for (__typeof(n + 1) i = (1) - ((1) > (n + 1));
       i != (n + 1) - ((1) > (n + 1)); i += 1 - 2 * ((1) > (n + 1))) {
    long long int prod = 1, sum = 0;
    for (int j = i; j < n + 1; j = nxt[j]) {
      if (prod >= (INF / a[j])) break;
      prod *= a[j];
      sum += a[j];
      if (check(sum, prod, nxt[j] - j - 1, k)) ans++;
      sum += nxt[j] - j - 1;
    }
  }
  cout << ans << endl;
}
