#include <bits/stdc++.h>
const int N = 200100;
const long long MAXI = 2ll * 1000000000ll * 1000000000ll;
using namespace std;
long long a[N];
int nxt_idx[N];
inline bool overflows(long long a, long long b) { return a > (LLONG_MAX / b); }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  long long k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  if (a[n - 1] == 1) nxt_idx[n - 1] = n - 1;
  for (int i = n - 2; i >= 0; i--) {
    if (a[i + 1] == 1)
      nxt_idx[i] = nxt_idx[i + 1];
    else if (a[i] == 1)
      nxt_idx[i] = i;
  }
  int res = 0;
  long long sum = 0, pro = 0;
  for (int i = 0; i < n; i++) {
    sum = pro = a[i];
    if (k == 1) res++;
    for (int j = i + 1; j < n;) {
      if (a[j] != 1) {
        if (overflows(pro, a[j])) break;
        pro = pro * a[j];
        if (pro > MAXI) break;
        sum += a[j];
        if (pro == sum * k) res++;
        j++;
      } else {
        sum++;
        if (pro % k != 0) {
          sum += nxt_idx[j] - j;
          j = nxt_idx[j] + 1;
          continue;
        }
        long long req_sum = pro / k;
        if (req_sum < sum) {
          sum += nxt_idx[j] - j;
          j = nxt_idx[j] + 1;
          continue;
        }
        if (req_sum == sum) {
          res++;
          sum += nxt_idx[j] - j;
          j = nxt_idx[j] + 1;
          continue;
        }
        long long diff = req_sum - sum;
        int ones_avail = (nxt_idx[j] - j);
        if (diff > ones_avail) {
          sum += nxt_idx[j] - j;
          j = nxt_idx[j] + 1;
          continue;
        }
        res++;
        sum += nxt_idx[j] - j;
        j = nxt_idx[j] + 1;
      }
    }
  }
  cout << res << '\n';
  return 0;
}
