def main():

  n, a = list(map(int, input().split()))

  xlst = list(map(int, input().split()))

  #xlst.insert(0, 0)



  """

  dp[i][j][k] ... iまででj個使ってkを作る

  dp[i][j][k] += dp[i - 1][j - 1][k - x]

  """

  

  """

  dp =  [[[0] * (50 * n + 1) for _ in range(n + 1)] for _ in range(n + 1)]

  for i in range(n + 1):

    dp[i][0][0] = 1

  

  

  for i in range(1, n + 1):

    x = xlst[i]

    dpi = dp[i]

    dpi_1 = dp[i - 1]

    for j in range(1, n + 1):

      dpij = dpi[j]

      dpi_1j = dpi_1[j]

      dpi_1j_1 = dpi_1[j - 1]

      for k in range(1, n * 50 + 1):

        if k >= x:

          #dp[i][j][k] += dp[i - 1][j - 1][k - x] + dp[i - 1][j][k]

          dpij[k] += dpi_1j_1[k - x] + dpi_1j[k]

        else:

          #dp[i][j][k] += dp[i - 1][j][k]

          dpij[k] += dpi_1j[k]



  ans = 0

  for j in range(1, n + 1):

    ans += dp[n][j][j * a]

  

  print(ans)



  """



  ans = 0

  dp = [[0] * (n * 50 + 1) for _ in range(n + 1)]

  dp[0][0] = 1

  for x in xlst:

    for j in range(n, 0, -1):

      for k in range(n * 50, x - 1, -1):

        dp[j][k] += dp[j - 1][k - x]

  for j in range(1, n + 1):

    ans += dp[j][j * a]

  print(ans)

main()
def main():

  n, a = list(map(int, input().split()))

  xlst = list(map(int, input().split()))



  """

  dp[i][j][k] ... iまででj個使ってkを作る

  dp[i][j][k] += dp[i - 1][j - 1][k - x]

  """

  

  """

  xlst.insert(0, 0)

  dp =  [[[0] * (50 * n + 1) for _ in range(n + 1)] for _ in range(n + 1)]

  for i in range(n + 1):

    dp[i][0][0] = 1

  

  

  for i in range(1, n + 1):

    x = xlst[i]

    dpi = dp[i]

    dpi_1 = dp[i - 1]

    for j in range(1, n + 1):

      dpij = dpi[j]

      dpi_1j = dpi_1[j]

      dpi_1j_1 = dpi_1[j - 1]

      for k in range(1, n * 50 + 1):

        if k >= x:

          #dp[i][j][k] += dp[i - 1][j - 1][k - x] + dp[i - 1][j][k]

          dpij[k] += dpi_1j_1[k - x] + dpi_1j[k]

        else:

          #dp[i][j][k] += dp[i - 1][j][k]

          dpij[k] += dpi_1j[k]



  ans = 0

  for j in range(1, n + 1):

    ans += dp[n][j][j * a]

  

  print(ans)



  """



  dp = [[0] * (n * 50 + 1) for _ in range(n + 1)]

  dp[0][0] = 1



  for x in xlst:

    for j in range(n, 0, -1):

      dpj = dp[j]

      dpj1 = dp[j - 1]

      for k in range(n * 50, x - 1, -1):

        dpj[k] += dpj1[k - x]



  print((sum([dp[j][j * a] for j in range(1, n + 1)])))

main()
def main():
    n, a = list(map(int, input().split()))
    xlst = list(map(int, input().split()))
    # xlst.insert(0, 0)
    """
  dp[i][j][k] ... iまででj個使ってkを作る
  dp[i][j][k] += dp[i - 1][j - 1][k - x]
  """
    """
  dp =  [[[0] * (50 * n + 1) for _ in range(n + 1)] for _ in range(n + 1)]
  for i in range(n + 1):
    dp[i][0][0] = 1
  for i in range(1, n + 1):
    x = xlst[i]
    dpi = dp[i]
    dpi_1 = dp[i - 1]
    for j in range(1, n + 1):
      dpij = dpi[j]
      dpi_1j = dpi_1[j]
      dpi_1j_1 = dpi_1[j - 1]
      for k in range(1, n * 50 + 1):
        if k >= x:
          #dp[i][j][k] += dp[i - 1][j - 1][k - x] + dp[i - 1][j][k]
          dpij[k] += dpi_1j_1[k - x] + dpi_1j[k]
        else:
          #dp[i][j][k] += dp[i - 1][j][k]
          dpij[k] += dpi_1j[k]
  ans = 0
  for j in range(1, n + 1):
    ans += dp[n][j][j * a]
  print(ans)
  """
    ans = 0
    dp = [[0] * (n * 50 + 1) for _ in range(n + 1)]
    dp[0][0] = 1
    for x in xlst:
        for j in range(n, 0, -1):
            for k in range(n * 50, x - 1, -1):
                dp[j][k] += dp[j - 1][k - x]
    for j in range(1, n + 1):
        ans += dp[j][j * a]
    print(ans)


main()

def main():
    n, a = list(map(int, input().split()))
    xlst = list(map(int, input().split()))
    """
  dp[i][j][k] ... iまででj個使ってkを作る
  dp[i][j][k] += dp[i - 1][j - 1][k - x]
  """
    """
  xlst.insert(0, 0)
  dp =  [[[0] * (50 * n + 1) for _ in range(n + 1)] for _ in range(n + 1)]
  for i in range(n + 1):
    dp[i][0][0] = 1
  for i in range(1, n + 1):
    x = xlst[i]
    dpi = dp[i]
    dpi_1 = dp[i - 1]
    for j in range(1, n + 1):
      dpij = dpi[j]
      dpi_1j = dpi_1[j]
      dpi_1j_1 = dpi_1[j - 1]
      for k in range(1, n * 50 + 1):
        if k >= x:
          #dp[i][j][k] += dp[i - 1][j - 1][k - x] + dp[i - 1][j][k]
          dpij[k] += dpi_1j_1[k - x] + dpi_1j[k]
        else:
          #dp[i][j][k] += dp[i - 1][j][k]
          dpij[k] += dpi_1j[k]
  ans = 0
  for j in range(1, n + 1):
    ans += dp[n][j][j * a]
  print(ans)
  """
    dp = [[0] * (n * 50 + 1) for _ in range(n + 1)]
    dp[0][0] = 1
    for x in xlst:
        for j in range(n, 0, -1):
            dpj = dp[j]
            dpj1 = dp[j - 1]
            for k in range(n * 50, x - 1, -1):
                dpj[k] += dpj1[k - x]
    print((sum([dp[j][j * a] for j in range(1, n + 1)])))


main()

-    # xlst.insert(0, 0) +  xlst.insert(0, 0) -    ans = 0 +            dpj = dp[j] +            dpj1 = dp[j - 1] -                dp[j][k] += dp[j - 1][k - x] -    for j in range(1, n + 1): -        ans += dp[j][j * a] -    print(ans) +                dpj[k] += dpj1[k - x] +    print((sum([dp[j][j * a] for j in range(1, n + 1)])))