#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int nxt[200005];
int f(int idx) {
  if (idx == v.size()) return v.size();
  nxt[idx] = f(idx + 1);
  if (v[idx] > 1)
    return idx;
  else
    return nxt[idx];
}
bool ok(double a, double b) {
  if (a * b >= LLONG_MAX / 3) return 0;
  return 1;
}
int main() {
  int n, k, inp;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &inp);
    v.push_back(inp);
  }
  f(0);
  long long int ans = 0;
  for (int i = 0; i < v.size(); i++) {
    long long int pro = 1;
    long long int sum = 0;
    int pre = i;
    int now = i;
    while (1) {
      int one = now - pre - 1;
      if (one > 0) {
        if (pro % k == 0) {
          long long int reqOne = pro / k - sum;
          if (reqOne > 0 && reqOne <= one) ans++;
        }
        sum += one;
      }
      if (now == v.size()) break;
      if (ok(pro, v[now])) {
        pro *= v[now];
        sum += v[now];
        if (sum * (long long int)k == pro) ans++;
      } else
        break;
      pre = now;
      now = nxt[now];
    }
  }
  cout << ans << '\n';
  return 0;
}
