Tak has N cards. On the i-th (1 \leq i \leq N) card is written an integer x_i. He is selecting one or more cards from these N cards, so that the average of the integers written on the selected cards is exactly A. In how many ways can he make his selection?
n, avg = map(int, input().split())
a = list(map(int, input().split()))

cnt = 0
for i in range(n):
  for j in range(i, n):
    sm = sum(a[i:j + 1])
    if avg * (j - i + 1) == sm:
      cnt += 1
print(cnt)
n, avg = map(int, input().split())
a = list(map(int, input().split()))
mxsm = sum(a) + 5

dp = [[0] * mxsm for _ in range(n + 5)]

dp[0][0] = 1
rs = 0
for x in a:
    dp2 = [[it for it in lin] for lin in dp]
    for i in range(1, n + 1):
        for j in range(x, mxsm + 1):
            if dp[i - 1][j - x]:
                dp2[i][j] += dp[i - 1][j - x]
    dp = dp2

for i in range(1, n + 1):
    if len(dp[i]) > avg * i:
        rs += dp[i][avg * i]

print(rs)

