PROGRAM ATCODER

implicit none
integer(16) :: n, a, i, nx, s, k, j, ans
integer(16), allocatable :: x(:), dp(:,:,:)

read(*,*) n, a
allocate (x(n))
read(*,*) (x(i), i=1,n)

nx = n*max(maxval(x),a)
allocate (dp(0:n,0:n,0:nx)) ! dp(j,k,s)→(1~j枚のカード,k枚えらぶ,合計はs)となる選び方の総数

do j = 0, n
	do k = 0, n
    	do s = 0, nx
        	if (s == 0 .and. k == 0 .and. j == 0) then 
            	dp(j,k,s) = 1
        	else if (j >= 1 .and. s < x(j)) then
            	dp(j,k,s) = dp(j-1,k,s)
            else if (j >= 1 .and. k >= 1 .and. s >= x(j)) then
            	dp(j,k,s) = dp(j-1,k,s) + dp(j-1,k-1,s-x(j))
            else
            	dp(j,k,s) = 0
            end if
        end do
    end do
end do

ans = 0
do k = 1,n
	ans = ans + dp(n,k,a*k)
end do

write(*,'(i0)') ans

END PROGRAM ATCODER