#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(12);
  int64_t n, k;
  cin >> n >> k;
  vector<int64_t> a(n);
  for (int64_t i = 0; i < n; ++i) cin >> a[i];
  vector<int64_t> l1(n);
  int64_t foo = n;
  for (int64_t i = n - 1; i >= 0; --i) {
    if (a[i] == 1) {
      if (foo == n) {
        foo = i;
      }
      l1[i] = foo;
    } else {
      foo = n;
    }
  }
  int64_t cnt = 0;
  for (int64_t l = 0; l < n; ++l) {
    int64_t p = 1, s = 0;
    for (int64_t r = l; r < n; ++r) {
      p *= a[r];
      s += a[r];
      if (p % s == 0 && p / s == k) {
        cnt++;
      }
      if (p > (s + n - 1 - r) * k) {
        break;
      }
      if (p < k * s) {
        if (a[r] == 1) {
          s += l1[r] - r;
          r = l1[r];
        }
      } else if (p > k * s) {
        if (a[r] == 1) {
          int64_t ss = p / k;
          if (s + l1[r] - r >= ss) {
            r += ss - s;
            s = ss;
          } else {
            s += l1[r] - r;
            r = l1[r];
          }
          if (p % s == 0 && p / s == k) {
            cnt++;
          }
        }
      }
    }
  }
  cout << cnt << '\n';
  return 0;
}
