#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 200000;
int N, K;
long long int maxPossible;
long long int A[MAX_N];
long long int ones[MAX_N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin >> N >> K;
  for (int i = 0; i < N; ++i) {
    cin >> A[i];
    maxPossible += A[i];
    if (A[i] > 1) {
      for (int j = 0; i - j > 0; ++j) {
        ones[i - j - 1] = j;
        if (A[i - j - 1] > 1) {
          break;
        }
      }
    }
  }
  for (int j = 0; N - j > 0; ++j) {
    ones[N - j - 1] = j;
    if (A[N - j - 1] > 1) {
      break;
    }
  }
  maxPossible *= K;
  int segmentCount = 0;
  for (int i = 0; i < N; ++i) {
    long long int product = 1L;
    long long int sum = 0L;
    for (int j = i; j < N; j += ones[j] + 1) {
      if (product > maxPossible / A[j]) {
        break;
      }
      product *= A[j];
      sum += A[j] + ones[j];
      if (product % K != 0) {
        continue;
      }
      long long int target = product / K;
      if (target <= sum && target >= sum - ones[j]) {
        ++segmentCount;
      }
    }
  }
  cout << segmentCount << '\n';
  return 0;
}
