//Time = O(n)
//space = O(n)
//we will store the prefix sum as key, and the index as value in a map(index denotes the prefix sum till that point
//we will iterate the array,calculate the prefix sum till that point, if (prefixsum-k) is present in the map, then find the index of prefixsum-k, subtract the current counter and find the maximim length
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,sum=0,k,x,j;
cin>>n>>k;
vector<int> a(n);
map<int,int> mp;
for(int i=0;i<n;i++)
{
cin>>a[i];
}
int mx=INT_MIN;
mp[0]=0;
for(int i=0;i<n;i++)
{
sum+=a[i];
if(mp.find(sum-k)!=mp.end())
{
j=mp[sum-k];
mx=max(mx,i-j);
}
mp[sum]=i+1;
}
if(mx<n)
cout<<++mx;
else
cout<<" no subarray where sum= k";
}