integer N,A
integer,allocatable,dimension(:)::X
integer(16),allocatable,dimension(:,:,:)::DP
integer(16) ans
read*,N,A
allocate(X(N))
read*,X
allocate(DP(0:N,0:N,0:50*N))
DP=0
DP(0,0,0)=1
do i=1,N
  do j=0,i
    do k=0,j*a
      if(k<x(i).or.j==0)then
        DP(i,j,k)=DP(i-1,j,k)
      else
        DP(i,j,k)=DP(i-1,j,k)+DP(i-1,j-1,k-x(i))
      end if
    end do
  end do
end do

ans=0
do i=1,N
  ans=ans+DP(N,i,i*A)
end do

print"(i0)",ans

end