#region Header #!/usr/bin/env python3 # from typing import * import sys import io import math import collections import decimal import itertools from queue import PriorityQueue import bisect import heapq def input(): return sys.stdin.readline()[:-1] sys.setrecursionlimit(1000000) #endregion # _INPUT = """2 2 # 1 3 # """ # sys.stdin = io.StringIO(_INPUT) MOD = 1000000007 def main(): N, K = map(int, input().split()) A = list(map(int, input().split())) sumA = sum(A) dp = [[[0 for _ in range(sumA+1)] for _ in range(N+1)] for _ in range(N+1)] dp[0][0][0] = 1 for n in range(N): for k in range(n+1): for a in range(sumA+1): if dp[n][k][a] > 0: dp[n+1][k][a] += dp[n][k][a] dp[n+1][k+1][a+A[n]] += dp[n][k][a] v = 0 for k in range(1, N+1): for a in range(K*k, sumA+1): v = (v + dp[N][k][a]) % MOD print(v) if __name__ == '__main__': main()