#!/usr/bin/env python3 from pprint import pprint from sys import setrecursionlimit, stdin from typing import Dict, Iterable, Set INF: int = 1 << 62 setrecursionlimit(1_000_000) def inputs(type_=int): ins = input().split(' ') ins = [x for x in ins if x != ''] if isinstance(type_, Iterable): return [t(x) for t, x in zip(type_, ins)] else: return list(map(type_, ins)) def input_(type_=int): a, = inputs(type_) return a inputi = input_ def inputstr(): return input_(str) def answer(res) -> None: print(res) exit() # start coding n, w = inputs() A = inputs() from itertools import product set_ = set() for it in product(range(3), repeat=n): s = 0 t = [] for i, f in enumerate(it): if f == 1: s += A[i] // 2 t.append(i) elif f == 2: s += A[i] t.append(i) if s == w: set_.add(tuple(t)) print(len(set_))