#include <bits/stdc++.h>
using namespace std;
int n, k;
int A[200005];
int nxt[200005];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> A[i];
  for (int i = n; i >= 0; i--)
    if (A[i + 1] == 1)
      nxt[i] = nxt[i + 1];
    else
      nxt[i] = i + 1;
  long long rez = 0;
  for (int st = 1; st <= n; st++) {
    long long sum = 0, product = 1;
    for (int dr = st; dr <= n; dr++) {
      if (A[dr] == 1) {
        rez += (product % k == 0 && product / k - sum > 0 &&
                product / k - sum <= nxt[dr] - dr);
        sum += nxt[dr] - dr;
        dr = nxt[dr] - 1;
      } else {
        if (product > (1LL << 62) / A[dr]) break;
        product *= A[dr];
        sum += A[dr];
        rez += (product == sum * k);
      }
    }
  }
  cout << rez;
  return 0;
}
