from collections import defaultdict
import copy
x=[]
d=defaultdict(int)
n,a=map(int,input().split())
dp=[[0]*n*51 for _ in range(n)]
for i in input().split():
    x.append(int(i)-a)
for i in x:
    tmp=copy.copy(d)
    for j in tmp:
        d[j+i]+=tmp[j]
    d[i]+=1
ans=d[0]
print(ans)