#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long n, k;
long long a[N], pref[N];
vector<long long> v;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    pref[i] = pref[i - 1] + a[i];
    if (a[i] > 1) v.push_back(i);
  }
  long long curmax = 2e13, ans = 0;
  for (long long l = 1; l <= n; l++) {
    long long curprod = a[l];
    long long curidx = l;
    long long cursum = a[l];
    while (true) {
      if (curprod == k * cursum) ans++;
      auto it = upper_bound(v.begin(), v.end(), curidx);
      if (it == v.end()) {
        long long extra = 0, have = n + 1 - curidx - 1;
        if (curprod % k == 0) {
          extra = curprod / k - cursum;
          if (extra > 0 && extra <= have) {
            ans++;
          }
        }
        break;
      } else {
        long long extra = 0, have = *it - curidx - 1;
        if (curprod % k == 0) {
          extra = curprod / k - cursum;
          if (extra > 0 && extra <= have) {
            ans++;
          }
        }
        if (curprod > curmax / a[*it]) break;
        curprod *= a[*it];
        cursum += pref[*it] - pref[curidx];
        curidx = *it;
      }
    }
  }
  cout << ans;
  return 0;
}
