from collections import defaultdict MOD = 10 ** 9 + 7 N, K = map(int, input().split()) A = list(map(lambda x: int(x) - K, input().split())) dp = defaultdict(int) dp[0] = 1 for a in A: for key, cnt in dp.copy().items(): dp[key + a] += cnt dp[key + a] %= MOD ans = sum(cnt for key, cnt in dp.items() if key >= 0) print((ans % MOD) - 1)