N, A = gets.split(/ /).collect{|i| i.to_i}


exit if N > 16

list_s = []
count_j = 0
list_l = []

gets.split(/ /).collect{|x|
	x = x.to_i
	if x == A
		count_j += 1
	elsif x < A
		list_s << (A - x)
	elsif
		list_l << (x - A)
	end
}

def make_patterns(list, i, pattern, results)
	if i == list.length
		if pattern.length > 0
			sum = pattern.inject(:+)
		else
			sum = 0
		end
		if results[sum]
			results[sum] += 1
		else
			results[sum] = 1
		end
	else
		make_patterns(list, i + 1, pattern, results)
		make_patterns(list, i + 1, pattern + [list[i]], results)
	end
end

results_s = {}
make_patterns(list_s, 0, [], results_s)

results_l = {}
make_patterns(list_l, 0, [], results_l)

pattern_count_j = 2 ** count_j
count = pattern_count_j - 1
results_s.each{|sum_s, count_s|
	if sum_s > 0 && count_l = results_l[sum_s]
		count += count_s * count_l * pattern_count_j
	end
}

p count


