#include <bits/stdc++.h>
using namespace std;
long long a[200005];
int nxt1[200005];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
  }
  for (int i = n - 1; i >= 0; i--) {
    if (a[i] == 1) nxt1[i] = nxt1[i + 1] + 1;
  }
  long long maxm = (long long)100000000 * k * n;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    long long mul = 1, sum = 0;
    for (int j = i; j < n; j++) {
      if (maxm / mul < a[j]) break;
      if (a[j] == 1) {
        if (mul % k == 0) {
          long long need = mul / k - sum;
          if (need <= nxt1[j] && need > 0) ans++;
        }
        sum = sum + nxt1[j];
        j = j + nxt1[j] - 1;
        continue;
      }
      mul = mul * a[j];
      sum = sum + a[j];
      if (mul % sum == 0 && mul / sum == k) ans++;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
