N, K = map(int,input().split()) A = list(map(int,input().split())) mod = int(1e9 + 7) for i in range(N): A[i] -= K dp = [[0 for j in range(20010)] for i in range(105)] dp[0][10000] = 1 ans = 0 for i in range(N): for j in range(20005): dp[i+1][j] += dp[i][j] if j >= A[i] and j - A[i] < 20005: dp[i+1][j] += dp[i][j - A[i]] dp[i+1][j] %= mod for j in range(10005): ans += dp[N][j + 10000] ans %= mod ans -= 1 if ans < 0: ans += mod print(ans)