#include <bits/stdc++.h>
using namespace std;
int a[200010];
vector<pair<int, int> > v;
const long long INF = 1e18;
int main() {
  int n, k;
  cin >> n >> k;
  v.push_back(make_pair(0, 0));
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    if (a[i] != 1) v.push_back(make_pair(a[i], i));
  }
  v.push_back(make_pair(0, n + 1));
  long long ans = 0;
  for (int i = 1; i + 1 < v.size(); i++) {
    long long prod = 1, currSum = 0;
    int betweenOnes = 0;
    int prevOnes = v[i].second - v[i - 1].second - 1;
    for (int j = i; j < i + 62 && j + 1 < v.size(); j++) {
      if (prod > INF / v[j].first) continue;
      if (j > i) betweenOnes += v[j].second - v[j - 1].second - 1;
      prod *= v[j].first;
      currSum += v[j].first;
      if (prod % k != 0) continue;
      long long sum = prod / k;
      int nextOnes = v[j + 1].second - v[j].second - 1;
      long long req = sum - currSum - betweenOnes;
      if (req > n || req < 0) continue;
      int l = max((int)req - prevOnes, 0);
      if (nextOnes < l) continue;
      int r = min(nextOnes, (int)req);
      ans += r - l + 1;
    }
  }
  if (k == 1) ans += n - int(v.size()) + 2;
  cout << ans << endl;
}
