from collections import defaultdict MOD = 10**9 + 7 def main(): import sys input = sys.stdin.read().split() idx = 0 N = int(input[idx]) idx += 1 K = int(input[idx]) idx += 1 A = list(map(int, input[idx:idx + N])) idx += N x_list = [a - K for a in A] dp = defaultdict(lambda: defaultdict(int)) dp[0][0] = 1 for x in x_list: temp_dp = defaultdict(lambda: defaultdict(int)) for c in list(dp.keys()): for s in list(dp[c].keys()): cnt = dp[c][s] # Not choose current x: retain the state temp_dp[c][s] = (temp_dp[c][s] + cnt) % MOD # Choose current x: add to new_c and new_s new_c = c + 1 new_s = s + x temp_dp[new_c][new_s] = (temp_dp[new_c][new_s] + cnt) % MOD dp = temp_dp ans = 0 for c in list(dp.keys()): if c < 1: continue current = dp[c] total = 0 for s in current: if s >= 0: total = (total + current[s]) % MOD ans = (ans + total) % MOD print(ans % MOD) if __name__ == "__main__": main()