Program Captain;
Var a:array[0..41]of longint;
n,Key,i,x,Ans:longint;
procedure kp(l,r:longint);
var
i,j,mid:longint;
begin
if l>=r then exit;
i:=l;j:=r;mid:=a[(l+r) div 2];
repeat
while a[i]<mid do inc(i);
while a[j]>mid do dec(j);
if i<=j then
begin
a[0]:=a[i];a[i]:=a[j];a[j]:=a[0];
inc(i);dec(j);
end;
until i>j;
kp(l,j);
kp(i,r)
end;
Procedure Jia(tot,x:longint);
Var i:longint;
Begin
Inc(tot,a[x]);
If tot>key then exit;
If tot=key then begin
inc(ans);Exit;
End;
For i:=x+1 to n do (jia(tot,i));
If x=n then exit;
End;
Begin
Assign(input,'password1.in');Reset(input);
Assign(output,'password1.out');Rewrite(output);
Readln(n,key);i:=0;
While n>0 do begin
Dec(n);Read(x);
If x=key then begin
inc(ans);
Continue;
End else
If (x=0) or (x>key) then continue
else begin
Inc(i);
a[i]:=x;
End;
End;n:=i;
kp(1,n);
For i:=1 to n do jia(0,i);
Writeln(ans);
Close(input);Close(output);
End.