def solve():
    N,A = map(int,input().split())
    x = list(map(lambda a: int(a)-A,input().split()))

    GETA = 2500
    dp = [[0] * 5000 for _ in range(N+1)]
    dp[0][2500] = 1

    for i in range(N):
        for j in range(5000):
            if dp[i][j] == 0 or j+x[i] >= 5000:
                continue
            dp[i+1][j+x[i]] += dp[i][j]
            dp[i+1][j] += dp[i][j]
    
    print(dp[N][GETA]-1)
        
if __name__ == '__main__':
    solve()