MOD = 10 ** 9 + 7 n, k = map(int, input().split()) a = list(map(lambda x: int(x)-k, input().split())) dp = [[0]*20010 for _ in range(n + 1)] dp[0][0] = 1 for i in range(n): for j in range(len(dp[i])): dp[i + 1][j] += dp[i][j] % MOD dp[i + 1][(j + a[i]) % len(dp[i])] += dp[i][j] % MOD ans = -1 for i in range(10001): ans += dp[n][i] print(ans % MOD)