from collections import * N, K = map(int, input().split()) A = list(map(int, input().split())) A = list(map(lambda x: x-K, A)) dp = defaultdict(int) dp[0] = 1 MOD = 10**9+7 for i in range(N): ndp = defaultdict(int) for k in dp: ndp[k] = (ndp[k]+dp[k])%MOD ndp[k+A[i]] = (ndp[k+A[i]]+dp[k])%MOD dp = ndp ans = 0 for k in dp: if k>=0: ans = (ans+dp[k])%MOD print((ans-1)%MOD)