#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