N,K = map(int,input().split()) lsA = list(map(int,input().split())) dp = [0]*(30000+1) offset = 15000 dp[offset] = 1 mod = 10**9+7 for i in range(N): a = lsA[i]-K dp2 = [0]*(30000+1) for j in range(30000+1): if 0<= j+a <=30000: dp2[j+a] += dp[j] dp2[j+a] %= mod dp2[j] += dp[j] dp2[j] %= mod dp = dp2 print((sum(dp[offset:])-1)%mod)