#include <bits/stdc++.h>
using namespace std;
signed main() {
  int64_t n, k;
  cin >> n >> k;
  vector<int64_t> a(n);
  vector<int64_t> nxt(n);
  for (auto &el : a) {
    cin >> el;
  }
  nxt[n - 1] = n;
  for (int64_t i = n - 2; i >= 0; --i) {
    if (a[i + 1] != 1) {
      nxt[i] = i + 1;
    } else {
      nxt[i] = nxt[i + 1];
    }
  }
  int64_t ans = 0;
  for (int64_t l = 0; l < n; ++l) {
    int64_t r = l;
    if (k == 1) {
      ans++;
    }
    int64_t mn = a[l];
    int64_t sum = a[l];
    while (nxt[r] != n && mn <= (1e18) / a[nxt[r]]) {
      mn *= a[nxt[r]];
      sum += a[nxt[r]] + nxt[r] - r - 1;
      r = nxt[r];
      int64_t now = -11;
      if (mn % k == 0) {
        now = mn / k;
      }
      if (sum <= now && now <= sum + nxt[r] - r - 1) {
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
