#include <bits/stdc++.h>
using namespace std;
const long long Nmax = 2e5 + 5;
long long a[Nmax];
long long num[Nmax];
long long N, n, k, ans;
void init() {
  long long cnt = 0;
  for (long long i = n; i >= 1; i--) {
    num[i] = cnt;
    if (a[i] == 1)
      cnt++;
    else
      cnt = 0;
  }
}
signed main() {
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  init();
  for (long long i = 1; i <= n; i++) {
    long long p = 1;
    long long s = 0;
    for (long long j = i; j <= n; j++) {
      if (p > 2e18 / a[j]) break;
      p *= a[j];
      s += a[j];
      ans += (s * k == p);
      if (num[j]) {
        if (p % k) {
          s += num[j];
          j += num[j];
          continue;
        }
        if (s * k < p && (s + num[j]) * k >= p) ans++;
        s += num[j];
        j += num[j];
      }
    }
  }
  cout << ans;
  return 0;
}
