n,a=map(int,input().split())
from collections import defaultdict
dp=defaultdict(int)
dp[0]=1
for i in map(int,input().split()):
    i-=a

    for k in sorted(dp.keys(),reverse=(i>=0)):
        dp[k+i]+=dp[k]
print(dp[0]-1)