n,a=map(int,input().split())
x=list(map(int,input().split()))
p=max(max(x),a)
s=[i-a for i in x]
def f(b,t):
    if b==0 and t==p*n:
        return 1
    elif b>0 and (t-s[b-1]<0 or t-s[b-1]>2*p*n):
        return f(b-1,t)
    elif b>0 and (0<=t-s[b-1] and t-s[b-1]<=2*p*n):
        return f(b-1,t)+f(b-1,t-s[b-1])
    else:
        return 0
print(f(n,n*p)-1)