def main(): m=10**9+7 n,k=map(int,input().split()) a=list(map(int,input().split())) for i in range(n): a[i]-=k dp=[[0]*20001 for _ in range(n+1)] dp[0][0]=1 for i in range(n): for j in range(-10000,10001): dp[i][j]%=m if -10000<=j+a[i] and j+a[i]<=10000: dp[i+1][j]+=dp[i][j] dp[i+1][j+a[i]]+=dp[i][j] print((sum(dp[n][:10000])-1+m)%m) main()