import times, strutils, sequtils, math, algorithm, tables, sets, lists, intsets import critbits, future, strformat, deques,heapqueue template `max=`(x,y) = x = max(x,y) template `min=`(x,y) = x = min(x,y) template `mod=`(x,y) = x = x mod y template scan2 = (scan(), scan()) template scan3 = (scan(), scan()) let read* = iterator: string {.closure.} = while true: (for s in stdin.readLine.split: yield s) proc scan(): int = read().parseInt proc scanf(): float = read().parseFloat proc toInt(c:char): int = return int(c) - int('0') proc solve():int= var n = scan() need = scan() a = @[0] & newseqwith(n,scan()) md = 10^9+7 r = a.sum()#100*n dp = newseqwith(n+1,newseqwith(n+1,newseqwith(r+1,0))) for i in 0..n: dp[i][0][0]=1 for i in 1..n: for j in 1..i: for k in 0..r: if k-a[i]>=0: dp[i][j][k]=dp[i-1][j][k]+dp[i-1][j-1][k-a[i]] else: dp[i][j][k]=dp[i-1][j][k] dp[i][j][k].mod=md #echo dp[n].join("\n") for j in 1..n: for k in 0..r: if j*need <= k: result+=dp[n][j][k] result.mod=md echo solve()