#include <bits/stdc++.h>
using namespace std;
int n;
long long k, a[200010], sum[200010];
int nx[200010];
int main() {
  while (scanf("%d%lld", &n, &k) != EOF) {
    for (int i = 1; i <= n; ++i) {
      scanf("%lld", a + i);
      sum[i] = sum[i - 1] + a[i];
    }
    int last = n + 1;
    for (int i = n; i >= 1; --i) {
      nx[i] = last;
      if (a[i] != 1) last = i;
    }
    long long res = 0;
    long long tmp = 0;
    for (int i = 1; i <= n; ++i) {
      tmp = a[i];
      if (k == 1) ++res;
      last = i;
      for (int j = nx[i]; j <= n + 1; j = nx[j]) {
        if (last != j - 1) {
          if (k * (sum[j - 1] - sum[i - 1]) >= tmp &&
              k * (sum[last] - sum[i - 1]) < tmp && tmp % k == 0)
            ++res;
        }
        if (j == n + 1) break;
        double x = tmp, y = a[j];
        if (x * y > 2e18) break;
        tmp *= a[j];
        if (tmp == k * (sum[j] - sum[i - 1])) ++res;
        last = j;
      }
    }
    printf("%lld\n", res);
  }
  return 0;
}
