#include <bits/stdc++.h>
using namespace std;
template <typename T>
T sqr(T x) {
  return x * x;
}
inline unsigned long long bit(int num) { return 1ull << num; }
const long long MAGIC = 4 * 1e18 / 1e8;
int getLog(unsigned long long val) {
  int cnt = 0;
  while (val) {
    ++cnt;
    val >>= 1;
  }
  return cnt;
}
int main() {
  long long n, k;
  cin >> n >> k;
  vector<unsigned long long> v(n);
  for (int i = 0; i < int(n); ++i) {
    cin >> v[i];
  }
  vector<int> next(n + 1);
  next[n] = n;
  vector<int> logs(n);
  for (int i = int(n) - 1; i >= 0; --i) {
    if (v[i] == 1) {
      next[i] = next[i + 1];
    } else {
      next[i] = i;
    }
    logs[i] = getLog(v[i]);
  }
  long long res = 0;
  for (int from = 0; from < int(n); ++from) {
    unsigned long long s = 0;
    unsigned long long p = 1;
    for (int j = from; j < n;) {
      if (v[j] != 1) {
        s += v[j];
        if (getLog(p) + logs[j] > 63) break;
        p *= v[j];
        if (s * k == p) ++res;
        ++j;
      } else {
        unsigned long long cnt = next[j] - j;
        unsigned long long ts = p / k;
        if (ts * k == p) {
          if (ts > s && ts <= s + cnt) {
            ++res;
          }
        }
        s += cnt;
        j = next[j];
      }
    }
  }
  cout << res << endl;
  return 0;
}
