#include <bits/stdc++.h>
using namespace std;
const int nax = 2e5 + 11;
const long long inf = 2e18 + 11;
int l[nax];
long long pre[nax];
int main() {
  int N, i, K;
  cin >> N >> K;
  vector<int> A(N + 1);
  for (i = 1; i <= N; ++i) {
    cin >> A[i];
  }
  pre[0] = 0LL;
  l[0] = 0;
  for (i = 1; i <= N; ++i) {
    l[i] = A[i] == 1 ? l[i - 1] : i;
    pre[i] = pre[i - 1] + A[i];
  }
  long long ans = 0;
  for (i = 1; i <= N; ++i) {
    long long pro = 1;
    int j = i;
    while (j > 0 && pro <= inf / A[j]) {
      pro *= A[j];
      int nextJ = l[j - 1];
      if (nextJ != j - 1 && pro % K == 0 && pre[i] - pre[j - 1] < pro / K &&
          pre[i] - pre[nextJ] >= pro / K) {
        ++ans;
      }
      if (pro % K == 0 && pro / K == pre[i] - pre[j - 1]) {
        ++ans;
      }
      j = nextJ;
    }
  }
  cout << ans << '\n';
  return 0;
}
