#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 200200;
const ll MAX = 2e18;
int n, k, a[N], len[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = n - 1; i >= 0; i--) {
    if (i + 1 < n && a[i] == a[i + 1])
      len[i] = len[i + 1] + 1;
    else
      len[i] = 1;
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ll p = a[i], s = a[i];
    if (k == 1) ans++;
    for (int j = i + 1; j < n; j++) {
      if (a[j] == 1) {
        if (p % k == 0 && p / k > s && p / k <= s + len[j]) ans++;
        s += len[j];
        j += len[j] - 1;
      } else {
        if (log(p) + log(a[j]) > log(MAX)) break;
        p *= a[j];
        s += a[j];
        if (p == k * s) ans++;
      }
      if (p > MAX) break;
    }
  }
  cout << ans << "\n";
}
