eval'N,S,K='+gets.split*?, S-=N*~-N/2*K p S<0?0:(b=1,*[0]*S 1.upto(N){|i|i.upto(S){|j|b[j]+=b[j-i] b[j]%=10**9+7}} b[S])