#include <bits/stdc++.h>
using namespace std;
int a[200005];
int nt[200005];
long long sum[200005];
int main() {
  long long ans = 0;
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    sum[i] = sum[i - 1] + a[i];
  }
  for (int i = n; i >= 1; i--) {
    if (a[i + 1] != 1)
      nt[i] = i + 1;
    else
      nt[i] = nt[i + 1];
  }
  for (int i = 1; i <= n; i++) {
    long long mul = a[i];
    if (k == 1) ans++;
    for (int j = nt[i]; j <= n; j = nt[j]) {
      if ((long double)mul * a[j] > 1e18) break;
      mul *= a[j];
      long long tmp = sum[j] - sum[i - 1];
      if (mul % tmp == 0 && mul / tmp == k)
        ans++;
      else if (j + 1 != nt[j] && mul % k == 0) {
        long long wa = mul / k;
        int le = nt[j] - j - 1;
        if (tmp <= wa && wa <= le + tmp) ans++;
      }
    }
  }
  printf("%lld\n", ans);
}
