#include <iostream> #include<cstdio> using namespace std; int data[105]; int n,m; int ans; void dfs(int i,int sum) { if(sum==m) { ans++; return ; } if(i>=n||sum>m) return; if(sum<m) { dfs(i+1,sum+data[i]); dfs(i+1,sum); } } int main() { freopen("1.txt","r",stdin); int i; while(cin>>n>>m) { ans=0; for(i=0;i<n;i++) cin>>data[i]; dfs(0,0); cout<<ans<<endl; } return 0; }