#include <bits/stdc++.h>
using namespace std;
long long ara[200005];
long long cnt_1[200005];
int main() {
  long long n, k;
  scanf("%lld %lld", &n, &k);
  long long maxi = LLONG_MAX;
  for (int i = 0; i < n; i++) {
    long long a;
    scanf("%lld", &a);
    ara[i] = a;
  }
  int cnt = 0;
  for (int i = n - 1; i >= 0; i--) {
    cnt_1[i] = cnt;
    if (ara[i] == 1)
      cnt++;
    else
      cnt = 0;
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    long long sum = 0;
    long long mul = 1;
    int j = i;
    while (j < n) {
      sum += ara[j];
      long long temp = maxi / ara[j];
      if (mul <= temp)
        mul *= ara[j];
      else
        break;
      if (cnt_1[j]) {
        if (mul % k == 0) {
          long long x = mul / k;
          x -= sum;
          if (x >= 0 && cnt_1[j] >= x) {
            ans++;
          }
        }
        sum += cnt_1[j];
        j += cnt_1[j];
      } else {
        if (mul % sum == 0 && mul / sum == k) ans++;
      }
      j++;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
