import sys

import numpy as np



n, a, *x = list(map(int, sys.stdin.read().split()))



def main():

    dp = np.zeros((n + 1, 2501), dtype=np.int64)

    dp[0, 0] = 1

    for i in range(n):

        dp[1:, x[i]:] += dp[:-1, :-x[i]].copy()

    i = np.arange(1, n + 1)

    print((dp[i, i * a].sum()))



if __name__ ==  '__main__':

    main()
import sys

from collections import defaultdict



n, a, *x = list(map(int, sys.stdin.read().split()))

for i in range(n): x[i] -= a



def main():

  dp = defaultdict(int); dp[0] = 1

  for i in range(n):

    ndp = dp.copy()

    for k, v in list(dp.items()):

      ndp[k+x[i]] += v

    dp = ndp

  print((dp[0] - 1))

  

if __name__ == '__main__':

  main()
import sys
import numpy as np

n, a, *x = list(map(int, sys.stdin.read().split()))


def main():
    dp = np.zeros((n + 1, 2501), dtype=np.int64)
    dp[0, 0] = 1
    for i in range(n):
        dp[1:, x[i] :] += dp[:-1, : -x[i]].copy()
    i = np.arange(1, n + 1)
    print((dp[i, i * a].sum()))


if __name__ == "__main__":
    main()

import sys
from collections import defaultdict

n, a, *x = list(map(int, sys.stdin.read().split()))
for i in range(n):
    x[i] -= a


def main():
    dp = defaultdict(int)
    dp[0] = 1
    for i in range(n):
        ndp = dp.copy()
        for k, v in list(dp.items()):
            ndp[k + x[i]] += v
        dp = ndp
    print((dp[0] - 1))


if __name__ == "__main__":
    main()

-import numpy as np +from collections import defaultdict +for i in range(n): +    x[i] -= a -    dp = np.zeros((n + 1, 2501), dtype=np.int64) -    dp[0, 0] = 1 +    dp = defaultdict(int) +    dp[0] = 1 -        dp[1:, x[i] :] += dp[:-1, : -x[i]].copy() -    i = np.arange(1, n + 1) -    print((dp[i, i * a].sum())) +        ndp = dp.copy() +        for k, v in list(dp.items()): +            ndp[k + x[i]] += v +        dp = ndp +    print((dp[0] - 1))