def main():
    n, a = list(map(int, input().split()))
    X = list(map(lambda x: int(x) - a, input().split()))
    m = sum([x for x in X if x < 0])
    p = sum([x for x in X if x > 0])
    if p == m == 0:
        print(pow(2, n) - 1)
        exit()
    dp = [[0] * (p - m + 1) for  _ in range(n + 1)]
    dp[0][1 - m] = 1
    for i in range(1, n + 1):
        for j in range(p - m + 1):
            if 0 <= j - X[i - 1] < p - m + 1:
                dp[i][j] = dp[i - 1][j] + dp[i - 1][j - X[i - 1]]
            else:
                dp[i][j] = dp[i - 1][j]
    print(dp[n][1 - m] - 1)

if __name__ == '__main__':
    main()
