N,K = map(int,input().split()) A = list(map(int,input().split())) P = 10 ** 9 + 7 C = 10 ** 4 * 2 + 1 base = 10 ** 4 dat = [0] * C dat[base] = 1 for a in A: nx = dat.copy() a -= K for i in range(C): if 0 <= i + a < C: nx[i + a] += dat[i] nx[i + a] %= P dat = nx ans = 0 for i in range(base,C): ans += dat[i] ans %= P print((ans-1) % P)