#coding: utf-8                                                                                                                                              

N, A = map(int, raw_input().split())
x = map(int, raw_input().split())
count = 0
if N>16:
    print 0

else:
    for bi in xrange(1, 2**N):
        b = str(bin(bi))[2:].zfill(N)
        s = 0.0
        for (i, a) in enumerate(b):
            if a == '1':
                s += x[i]
        if s/b.count('1') == A:
            count += 1
            #print b                                                                                                                                        
    print count