N , A = map(int, input().split())
x = [0] + list((map(int, input().split())))

ans = 0
for num in range(1, N+1): #num枚選んで平均をAにする
    goal = num * A
    dp = [[0 for _ in range(goal + 1)] for _ in range(N+1)] # iこ目までみてjをつくる方法
    dp[0][0] = 1
    for i in range(1, N+1):
        for j in range(goal+1):
            dp[i][j] += dp[i-1][j]
            if j >= x[i]:
                dp[i][j] += dp[i-1][j-x[i]]
    
    ans += dp[N][goal]

print(ans)