#include <bits/stdc++.h>
using namespace std;
bool isoverflow(long long x, long long y) {
  if (x < y) {
    swap(x, y);
  }
  long long z = 4e18;
  if (x >= (long double)z / (long double)y) {
    return 1;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, k;
  cin >> n >> k;
  long long arr[n], patanahi[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long pro = 1, sum = 0, cnt = 0;
  long long j;
  patanahi[n - 1] = n;
  for (int i = n - 1; i > 0; i--) {
    if (arr[i] != 1 || arr[i - 1] != 1) {
      patanahi[i - 1] = i;
    } else
      patanahi[i - 1] = patanahi[i];
  }
  for (int i = 0; i < n; i++) {
    pro = 1, sum = 0, j = i;
    while (j < n) {
      if (!isoverflow(pro, arr[j])) {
        pro *= arr[j];
        sum += arr[j];
      } else
        break;
      long long z = j;
      j = patanahi[j];
      if (pro >= 1LL * k * sum && 1ll * k * (sum + j - z - 1) >= pro &&
          pro % k == 0) {
        cnt++;
      }
      sum += j - z - 1;
    }
  }
  cout << cnt;
}
