#include <bits/stdc++.h>
using namespace std;
long long LIM = 250;
long long BIG = 3e18;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long N, K;
  cin >> N >> K;
  vector<long long> A(N), nex(N);
  for (long long i = 0; i < N; i++) {
    cin >> A[i];
  }
  nex[N - 1] = N;
  for (long long i = N - 2; i >= 0; i--) {
    if (A[i] == 1) {
      if (A[i + 1] == 1)
        nex[i] = nex[i + 1];
      else
        nex[i] = i + 1;
    } else {
      nex[i] = i + 1;
    }
  }
  long long ans = 0;
  for (long long i = 0; i < N; i++) {
    long long prod = 1;
    long long sum = 0;
    long long cur = i;
    for (long long j = 0; j < LIM && cur < N; j++) {
      if (A[cur] == 1) {
        if (prod % K == 0 && prod > sum * K &&
            prod <= (sum + nex[cur] - cur) * K) {
          ans++;
        }
        sum += nex[cur] - cur;
      } else if ((long double)A[cur] * prod > BIG) {
        break;
      } else {
        prod *= A[cur];
        sum += A[cur];
        if (prod == sum * K) {
          ans++;
        }
      }
      cur = nex[cur];
    }
  }
  cout << ans;
  return 0;
}
