#include <bits/stdc++.h>
using namespace std;
long long n;
long long k;
long long a[200005], sum[200005], jmp[200005], ans = 0;
int main() {
  cin >> n >> k;
  memset(sum, 0, sizeof(sum));
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum[i] = sum[i - 1] + a[i];
  }
  jmp[n] = n;
  jmp[n + 1] = n + 1;
  for (int i = n - 1; i >= 1; i--) {
    if (a[i] == 1)
      jmp[i] = jmp[i + 1];
    else
      jmp[i] = i;
  }
  for (int i = 1; i <= n; i++) {
    long long mul = 1;
    long long j = i;
    long long last = j;
    while (j <= n && 2e18 / a[j] >= mul) {
      mul = mul * a[j];
      long long tmp = sum[j] - sum[i - 1];
      last = j;
      j = jmp[j + 1];
      if (mul % k == 0 && mul / k >= tmp && mul / k <= tmp + j - last - 1)
        ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
