#include<iostream>
using namespace std;
long long n;
long long key;
long long a[45];
long long ans;
void dfs(int sum,int num,int start){
if(num==n){
if(sum==key){
ans++;
}
return;
}
dfs(sum,num+1,start+1);
dfs(sum+a[start],num+1,start+1);
}
int main(){
freopen("password1.in","r",stdin);
freopen("password1.out","w",stdout);
cin>>n>>key;
for(int i=1;i<=n;i++){
cin>>a[i];
}
dfs(0,0,1);
cout<<ans<<endl;
return 0;
}