import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
from collections import defaultdict
from copy import copy
def resolve():
    n,a=map(int,input().split())
    X=list(map(lambda x:int(x)-a,input().split()))
    dp=defaultdict(int)
    dp[0]=1
    for x in X:
        ndp=copy(dp)
        for key,val in dp.items():
            ndp[key+x]+=val
        dp=ndp

    print(dp[0]-1)
resolve()