#include <bits/stdc++.h>
struct IO {
  static const int L = 1000000;
  char a[L], b[L], *s, *t, *p, c;
  IO() : p(b) {}
  ~IO() { fwrite(b, 1, p - b, stdout); }
  char gc() {
    if (s == t) t = (s = a) + fread(a, 1, L, stdin);
    return s == t ? EOF : *s++;
  }
  void gs(char *st) {
    for (c = gc(); !isgraph(c); c = gc())
      ;
    *st++ = c;
    for (c = gc(); isgraph(c); c = gc()) *st++ = c;
    *st++ = 0;
  }
  template <class T>
  operator T() {
    static T x;
    static bool neg;
    for (c = gc(); c != '-' && !isdigit(c); c = gc())
      ;
    if ((neg = c == '-')) c = gc();
    x = c - '0';
    for (c = gc(); isdigit(c); c = gc()) x = x * 10 + (c - '0');
    return neg ? -x : x;
  }
  void pc(const char ch) {
    if (p == b + L) fwrite(p = b, 1, L, stdout);
    *p++ = ch;
  }
  template <class T>
  void print(T x, const char end = '\n') {
    static char cs[30], *q;
    static T y;
    if (x == 0)
      pc('0');
    else {
      if (x < 0) pc('-'), x = -x;
      for (q = cs; x; x = y) y = x / 10, *q++ = x - y * 10 + '0';
      while (q != cs) pc(*--q);
    }
    if (end) pc(end);
  }
  void ps(const char *st, const char end = '\n') {
    while (*st) pc(*st++);
    if (end) pc(end);
  }
  void pd(const int x) {
    pc('0' + x);
    pc('\n');
  }
} io;
const int N = 200003;
long long a[N], ss[N], k, ans;
int n, nxt[N];
long long sum(int l, int r) { return ss[l] - ss[r + 1]; }
int main() {
  static int i, llp;
  n = io;
  k = io;
  for ((i) = (1); (i) <= (n); ++(i)) {
    a[i] = io;
    if (a[i] > 1) {
      nxt[llp] = i;
      llp = i;
    }
  }
  nxt[llp] = n + 1;
  llp = n + 1;
  for ((i) = (n); (i) >= (1); --(i)) {
    if (a[i] == 1)
      nxt[i] = llp;
    else
      llp = i;
  }
  ss[n + 1] = 0;
  for ((i) = (n); (i) >= (1); --(i)) ss[i] = ss[i + 1] + a[i];
  static long long p, s, lim, lp;
  static int j, lj;
  for ((i) = (1); (i) <= (n); ++(i)) {
    p = 1;
    lim = k * ss[i];
    if (a[i] == 1) {
      j = nxt[i];
      lj = i;
      if (k == 1) ++ans;
    } else
      j = i, lj = 0;
    for (; j; j = nxt[j]) {
      0;
      0;
      lp = p;
      if (j <= n) {
        s = sum(i, j);
        if (lj && lj < j - 1) {
          0;
          if (k * sum(i, lj) < lp && lp < k * s && lp % k == 0 &&
              lp / k - sum(i, lj) <= j - lj - 1)
            ++ans, 0;
        }
        if (p > lim / a[j]) break;
        p = p * a[j];
        0;
        0;
        if (p == k * s) ++ans, 0;
      } else if (lj && a[n] == 1) {
        if (k * sum(i, lj) < lp && lp <= k * sum(i, n) && lp % k == 0 &&
            lp / k - sum(i, lj) <= n - lj)
          ++ans, 0;
      }
      lj = j;
    }
  }
  io.print(ans);
  return 0;
}
