#include<bits/stdc++.h>
#define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
using namespace std;
int main()
{
faster
ll n,x,i,res=0,l=0,t=0,r;
cin>>n>>x;
vector<ll> a(n);
for(i=0;i<n;i++) cin>>a[i];
for(r=0;r<n;r++)
{
t+=a[r];
while(t>x&&l<=r)
{
t-=a[l];
l++;
}
if(t==x) res++;
}
cout<<res;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBmYXN0ZXIgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbygwKTtjaW4udGllKDApO2NvdXQudGllKDApOwojZGVmaW5lIGxsIGxvbmcgbG9uZwp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpCnsKICAgIGZhc3RlcgogICAgbGwgbix4LGkscmVzPTAsbD0wLHQ9MCxyOwogICAgY2luPj5uPj54OwogICAgdmVjdG9yPGxsPiBhKG4pOwogICAgZm9yKGk9MDtpPG47aSsrKSBjaW4+PmFbaV07CiAgICBmb3Iocj0wO3I8bjtyKyspCiAgICB7CiAgICAgICAgdCs9YVtyXTsKICAgICAgICB3aGlsZSh0PngmJmw8PXIpCiAgICAgICAgewogICAgICAgICAgICB0LT1hW2xdOwogICAgICAgICAgICBsKys7CiAgICAgICAgfQogICAgICAgIGlmKHQ9PXgpIHJlcysrOwogICAgfQogICAgY291dDw8cmVzOwp9