#include <bits/stdc++.h>
using namespace std;
int n;
long long k, a[200010], ans;
int nxt[200010];
int main() {
  scanf("%d%lld", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  int pre = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] != 1) {
      nxt[pre] = i;
      pre = i;
    } else {
      nxt[i] = pre;
    }
  }
  for (int i = 1; i <= n; i++) {
    int j = i;
    long long s = 0, p = 1;
    if (a[i] == 1) {
      j = nxt[nxt[i]];
      if (k == 1) ans++;
      s = j - i;
    }
    while (j) {
      if (a[j] > 1e18 / p) break;
      s += a[j];
      p *= a[j];
      int cnt = 0;
      if (!nxt[j])
        cnt = n - j;
      else
        cnt = nxt[j] - j - 1;
      if (p % k == 0 && p / k >= s && p / k <= s + cnt) ans++;
      s += cnt;
      j = nxt[j];
    }
  }
  printf("%lld", ans);
  getchar();
  getchar();
  return 0;
}
