#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n) { return (n % 1000000007); }
long long gcd(long long a, long long b) {
  if (a == 0 || b == 0) return 0;
  if (b == 1)
    return b;
  else
    return gcd(b, a % b);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  long long v[n + 1];
  long long skip[n + 1];
  for (long long i = 1; i <= n; i++) cin >> v[i];
  for (long long i = n; i >= 1; i--) {
    if (v[i] == 1) {
      if (i == n)
        skip[i] = n + 1;
      else
        skip[i] = skip[i + 1];
    } else
      skip[i] = i;
  }
  long long ans = 0LL;
  for (long long i = 1; i <= n; i++) {
    long long s = 0LL;
    long long p = 1LL;
    for (long long j = i; j <= n; j++) {
      if (LLONG_MAX / v[j] < p) {
        break;
      }
      if (skip[j] == j || j == i) {
        s += v[j];
        p *= v[j];
        if (p == k * s) {
          ans++;
        }
      } else {
        if (p % k == 0 && p > s && p / k - s > 0) {
          long long shift = min(p / k - s, skip[j] - j);
          s += shift;
          if (p == k * s) {
            ans++;
          }
          j += shift;
          j--;
        } else {
          s += (skip[j] - j);
          if (p == k * s) {
            ans++;
          }
          j = skip[j];
          j--;
        }
      }
    }
  }
  cout << ans << '\n';
}
