#include <bits/stdc++.h>
using namespace std;
const int N = 110;
long long n,m,ans;
long long a[N];
void sou(long long x,long long u){
if(u == m){
ans++;return;
}
if(x > n)return;
sou(x+1,u+a[x]);
sou(x+1,u);
}
int main(){
freopen("password1.in","r",stdin);
freopen("password1.out","w",stdout);
scanf("%lld%lld",&n,&m);
for(int i = 1;i <= n;i++)scanf("%lld",&a[i]);
sou(1,0);
printf("%lld",ans);
return 0;
}