Program HOC24;
var st,st1,st2: string;
i,n,d,k,j: integer;
t,m: longint;
a: array[1..10000] of integer;
f: text;
const fi='SUBSUM.INP' ;
fo = 'SUBSUM.OUT' ;
Procedure ip;
begin
assign(f,fi);
reset(f);
readln(f,n,m);
for i:=1 to n do read(f,a[i]);
close(f);
end;
Procedure out;
begin
assign(f,fo);
rewrite(f);
d:=0;
for i:=1 to n-1 do
Begin
If a[i]=m then d:=d+1;
for j:=i+1 to n do
begin
t:=0;
for k:=i to j do t:=t+a[k];
if t=m then d:=d+1;
end;
End;
if a[n]=m then d:=d+1; write(f,d);
close(f);
end;
Begin
ip;
out;
End.