#include <bits/stdc++.h>
using namespace std;
long long n, k, a[200005], nxt[200005], ans;
bool check(long long sum, long long pro, long long len) {
  long long temp = pro - sum * k;
  if (temp % k) return false;
  if (temp / k >= 0 && temp / k <= len)
    return true;
  else
    return false;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = n, pos = n + 1; i >= 1; i--) {
    nxt[i] = pos;
    if (a[i] > 1) pos = i;
  }
  for (int i = 1; i <= n; i++) {
    long long pro = 1, sum = 0;
    for (int j = i; j <= n; j = nxt[j]) {
      if (pro >= 1e18 / a[j]) break;
      pro *= a[j];
      sum += a[j];
      if (check(sum, pro, nxt[j] - j - 1)) ans++;
      sum += nxt[j] - j - 1;
    }
  }
  cout << ans << endl;
}
