#include<bits/stdc++.h>#define int long longusingnamespacestd;intn,target;vector<int>gen(vector<int>&a){vector<int>A;A.push_back(0);intn=a.size();for(inti=0;i<n;i++){for(intj=A.size()-1;j>=0;j--){A.push_back(A[j]+a[i]);}}sort(A.begin(),A.end());returnA;}signedmain(){cin>>n>>target;vector<int>a;vector<int>b;intx;for(inti=0;i<n;i++){cin>>x;if(i<n/2){a.push_back(x);}else{b.push_back(x);}}vector<int>A=gen(a);vector<int>B=gen(b);intans=0;for(inti=0;i<A.size();i++){ans+=upper_bound(B.begin(),B.end(),target-A[i])-lower_bound(B.begin(),B.end(),target-A[i]);}cout<<ans<<"\n";}