#include<bits/stdc++.h>
#define LL long long
#define F(x,y,z) for(int i=x;i<=y;i+=z)
using namespace std;
LL n,m,ans;
LL a[100005];
void dg(int dep,int money)
{
if(dep>n)
{
if(money==m) ans++;
}
else
{
dg(dep+1,money);
if(money+a[dep]<=m)
{
dg(dep+1,money+a[dep]);
}
}
}
int main()
{
cin>>n>>m;
F(1,n,1)
{
cin>>a[i];
}
dg(1,0);
cout<<ans<<'\n';
return 0;
}