#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  long long int a[200001] = {0};
  long long int pos[200001] = {-1};
  long long int i, j;
  for (i = 0; i < n; ++i) cin >> a[i];
  for (i = n - 1; i >= 0; --i) {
    if (a[i] == 1) pos[i] = i;
    if (i < n - 1 && a[i + 1] == 1) pos[i] = pos[i + 1];
  }
  long long int m = 0, p = 1, s = 0;
  for (i = 0; i < n; i++) {
    p = 1, s = 0;
    for (j = i; j < n; j++) {
      if (log(p) + log(s) > log(2 * 1e18)) break;
      p *= a[j];
      if (a[j] == 1) {
        if (p % k == 0 && s < p / k && pos[j] - j + s + 1 >= p / k) m++;
        s += pos[j] - j + 1;
        j = pos[j];
      } else {
        s += a[j];
        if (p % s == 0 && p / s == k) m++;
      }
    }
  }
  cout << m << "\n";
  return 0;
}
