N, K = map(int, input().split()) A = list(map(int, input().split())) for i in range(N): A[i] -= K MOD = 10**9+7 dp = [[0 for _ in range(20001)] for _ in range(N+1)] dp[0][10000] = 1 for i in range(N): a = A[i] for j in range(20001): dp[i+1][j] = dp[i][j] if (j-a) >= 0 and j-a <= 20000: dp[i + 1][j] += dp[i][j-a] ans = 0 for i in range(10000, 20001): ans += dp[N][i] ans %= MOD print(ans-1)