n,k = map(int,input().split()) a = list(map(int,input().split())) dp = [0]*(20001) dp[10000] = 1 mod = 10**9+7 for i in range(n): x = a[i]-k ndp = [0]*(20001) for j in range(20001): if dp[j] > 0: ndp[j+x] += dp[j] ndp[j+x] %= mod ndp[j] += dp[j] dp = ndp print((sum(dp[10000:])-1)%mod)