import sys import pypyjit import itertools import heapq import math from collections import deque, defaultdict import bisect input = sys.stdin.readline sys.setrecursionlimit(10 ** 6) pypyjit.set_param('max_unroll_recursion=-1') def index_lt(a, x): 'return largest index s.t. A[i] < x or -1 if it does not exist' return bisect.bisect_left(a, x) - 1 def index_le(a, x): 'return largest index s.t. A[i] <= x or -1 if it does not exist' return bisect.bisect_right(a, x) - 1 def index_gt(a, x): 'return smallest index s.t. A[i] > x or len(a) if it does not exist' return bisect.bisect_right(a, x) def index_ge(a, x): 'return smallest index s.t. A[i] >= x or len(a) if it does not exist' return bisect.bisect_left(a, x) N, K = map(int, input().split()) A = list(map(int, input().split())) mod = 10 ** 9 + 7 D = [a - K for a in A] L = 20000 dp = [[0 for _ in range(L + 10)] for _ in range(N + 1)] dp[0][10000] = 1 for i in range(N): for j in range(L + 1): if 0 <= j + D[i] <= L: dp[i + 1][j + D[i]] += dp[i][j] dp[i + 1][j + D[i]] %= mod dp[i + 1][j] += dp[i][j] dp[i + 1][j] %= mod ans = 0 for j in range(10000, 20000 + 1): ans += dp[N][j] ans %= mod print((ans - 1) % mod)