# coding: utf-8 # Your code here! N,K=map(int,input().split()) A=list(map(int,input().split())) ans=0 dp=[[0]*10001 for i in range(N+1)] dp[0][0]=1 for a in A: for n in range(N)[::-1]: for i in range(10001)[::-1]: if a+i<=10000: dp[n+1][a+i]+=dp[n][i] for n in range(1,N+1): ans+=sum(dp[n][n*K:]) print(ans)