local n, a = io.read("*n", "*n")
local t = {}
for i = 1, n * 50 * n do
  t[i] = 0
end
for i = 1, n do
  local x = io.read("*n")
  for j = i - 1, 1, -1 do
    for k = n * 50 - x, 1, -1 do
      if 0 < t[n * 50 * (j - 1) + k] then
        t[n * 50 * j + k + x] = t[n * 50 * j + k + x] + t[n * 50 * (j - 1) + k]
      end
    end
  end
  t[x] = t[x] + 1
end
local cnt = 0
for i = 1, n do
  cnt = cnt + t[n * 50 * (i - 1) + a * i]
end
print(cnt)
