#include <bits/stdc++.h>
const size_t N = 2 * 100002;
int main(void) {
  long long n, k, res = 0;
  std::cin >> n >> k;
  int arr[N];
  for (long long i = 0; i < n; ++i) std::cin >> arr[i];
  int next[N];
  next[n - 1] = n;
  for (long long i = n - 2; i >= 0; --i)
    next[i] = arr[i + 1] != 1 ? i + 1 : next[i + 1];
  for (long long left = 0; left < n; ++left) {
    long long right = left;
    long long mult = arr[left];
    long long sum = arr[left];
    if (mult == sum * k) res += 1;
    while (next[right] != n) {
      if (LLONG_MAX / mult < arr[next[right]]) break;
      mult *= arr[next[right]];
      sum += next[right] - right - 1 + arr[next[right]];
      right = next[right];
      int k_mult = 0;
      if (mult % k == 0) k_mult = mult / k;
      if (sum <= k_mult && k_mult <= sum + next[right] - right - 1) res += 1;
    }
  }
  std::cout << res << "\n";
}
