#include <bits/stdc++.h>
using namespace std;
const long long inf = 2e18;
bool check(long long a, long long b) {
  if (a >= (inf + b - 1) / b) return true;
  return false;
}
signed main() {
  long long n, k;
  scanf("%lld %lld", &n, &k);
  long long A[n];
  for (long long i = 0; i < n; i++) scanf("%lld", &A[i]);
  long long cnt = 0;
  long long next[n];
  if (A[n - 1] == 1LL)
    next[n - 1] = n;
  else
    next[n - 1] = n - 1;
  for (long long i = n - 2; i >= 0; i--) {
    if (A[i] == 1LL)
      next[i] = next[i + 1];
    else
      next[i] = i;
  }
  for (long long i = 0; i < n; i++) {
    long long P = A[i];
    long long S = A[i];
    if (k == 1) cnt++;
    long long idx = i + 1;
    while (idx < n) {
      if (A[idx] == 1LL) {
        if (P % k == 0) {
          if (P / k > S && P / k <= S + next[idx] - idx) cnt++;
        }
        S += next[idx] - idx;
        idx = next[idx];
      } else {
        if (check(P, A[idx])) break;
        P *= A[idx];
        S += A[idx];
        if (P % S == 0 && P / S == k) cnt++;
        idx++;
      }
    }
  }
  printf("%lld\n", cnt);
  return 0;
}
