#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const long long inf = 2e18 + 42;
long long a[N], skip[N];
int main() {
  int n;
  long long k;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  long long ans = 0;
  for (int i = n; i >= 1; --i) {
    if (a[i] == 1) {
      skip[i] = skip[i + 1] + 1;
    }
  }
  for (int i = 1; i <= n; ++i) {
    long long sum = 0, prod = 1;
    for (int j = i; j <= n; ++j) {
      if (double(prod) * a[j] > inf) {
        break;
      }
      prod *= a[j];
      sum += a[j];
      if (prod == sum * k) {
        ++ans;
      }
      if (skip[j] > 1) {
        if (prod % k == 0) {
          long long temp = prod / k;
          if (sum < temp and temp <= sum + skip[j] - 1) {
            ++ans;
          }
        }
        sum += skip[j] - 1;
        j += skip[j] - 1;
      }
    }
  }
  cout << ans;
}
