N,K=map(int,input().split()) A=list(map(int,input().split())) mod=10**9+7 DP=[1,1] for i in range(3,N+1): NDP=[0]*(i*(i-1)//2+1) for j in range(i): for k in range(len(DP)): NDP[j+k]+=DP[k] DP=[ndp%mod for ndp in NDP] print(sum(DP[:K+1])%mod)