#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<algorithm>
#include<cmath>
#include<set>
#include<map>
#include<cstdio>
using namespace std;
#define int long long
#define inf 1000000000000000001
#define mn 300005
#define FLN "test"
int n, A[mn], k;
int Pfx[mn]; // Prefix Sum
int Prv[mn]; // Prv[i] is the position right after the nearest 'good' number
main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
Pfx[0]=0;
cin>>n>>k;
for (int i=1; i<=n; i++)
{
cin>>A[i];
Pfx[i]=Pfx[i-1]+A[i];
}
int ptr=0;
for (int i=1; i<=n; i++)
{
Prv[i]=ptr+1;
if (A[i]>1) ptr=i;
}
int ans=0;
for (int i=1; i<=n; i++)
{
int curprd=1; // current product
int ptr=i;
while (ptr>0)
{
if (inf/A[ptr]<=curprd) break; // Compare these instead of multiplying reduce the risk of overflowing
curprd*=A[ptr];
int l=(Pfx[i]-Pfx[ptr-1])*k; //pos of the current 'good' number
ptr=Prv[ptr];
if (ptr<=0) break;
int r=(Pfx[i]-Pfx[ptr-1])*k; //pos of the next 'good' number plus one
if (curprd%k==0 && curprd>=l && curprd<=r) ans++; //find out if there are any solution between the 1's
ptr--;
}
}
cout<<ans;
}
// PLEASE REMOVE COUT DEBUG, FILE-OPENING FUNCTIONS BEFORE SUBMITTING
// Code by low_
// Link: http://c...content-available-to-author-only...s.com/contest/992/problem/D
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPHZlY3Rvcj4KI2luY2x1ZGU8cXVldWU+CiNpbmNsdWRlPGRlcXVlPgojaW5jbHVkZTxhbGdvcml0aG0+CiNpbmNsdWRlPGNtYXRoPgojaW5jbHVkZTxzZXQ+CiNpbmNsdWRlPG1hcD4KI2luY2x1ZGU8Y3N0ZGlvPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwojZGVmaW5lIGludCBsb25nIGxvbmcKI2RlZmluZSBpbmYgMTAwMDAwMDAwMDAwMDAwMDAwMQojZGVmaW5lIG1uIDMwMDAwNQ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