#include <cstdio>
using namespace std;
const int maxn = 100000+100;
FILE *fin, *fout;
int n, k, A[maxn], ans=0;
int gcd(int a, int b) { return b==0?a:gcd(b, a%b); }
inline int max(int a, int b) { return a<b?b:a; }
int main() {
fin = fopen("tarmy.in", "r");
fout = fopen("tarmy.out", "w");
fscanf(fin, "%d%d", &n, &k);
for(int i = 1; i <= n; i++) {
int tmp;
fscanf(fin, "%d", &tmp);
A[i] = A[i-1]+tmp;
}
int L=1, R=1;
while(R <= n) {
bool flag = true;
int pos;
while(flag) {
R++;
for(int i = R-1; i >= L; i--)//对A[R]进行比较
if(gcd((A[R]-A[R-1]), (A[i]-A[i-1])) != 1) { flag = false; R--; pos = i+1; break; }
}
if(A[R]-A[L-1] >= k) ans = max(ans, R-L+1);
L = R = pos;
}
fprintf(fout, "%d\n", ans);
return 0;
}