#include <iostream>
#include <limits.h>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
using namespace std;
using ll = long long;
#pragma region 상하좌우 / 위치
const pair<int, int> dir[]
{
{ 1, 0 },
{ -1, 0 },
{ 0, -1 },
{ 0, 1 },
};
#define _y first
#define _x second
#pragma endregion
#pragma region 빠른 입출력
#define FAST_IO() \
{\
ios::sync_with_stdio(false);\
cin.tie(NULL); \
cout.tie(NULL); \
}\
#pragma endregion
vector<int> v;
int n, s, cnt;
void dfs(int idx = 0, int sum = 0)
{
if (idx == n)
return;
int val = sum + v[idx];
if (val == s)
cnt++;
dfs(idx + 1, sum);
dfs(idx + 1, val);
}
int main()
{
FAST_IO();
cin >> n >> s;
v.resize(n);
for (int i = 0; i < n; i++)
cin >> v[i];
dfs();
cout << cnt;
}