output_description: Print the number of ways for the children to share candies, modulo 10^9 + 7.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N K
      a_1 a_2 \ldots a_N
attempt: import numpy as np
  from numba import njit
  
  @njit( cache=True)
  def main():
      N,K=map(int,input().split())
      a=np.array([int(i) for i in input().split()],dtype=np.int64)
      MOD=10**9+7
  
      dp=np.full((N+1,K+1),0,dtype=np.int64)
      c=np.full(K+2,0,dtype=np.int64)
  
      dp[0][0]=1
  
  
      for i in range(1,N+1):
          c[0]=0
          for j in range(1,K+2):
              c[j]=(c[j-1]+dp[i-1][j-1])%MOD
          for j in range(K+1):
              dp[i][j]=(c[j+1]-c[max(0,j-a[i-1])])%MOD
  
      print(dp[N][K])
  
  def main()
  
problem_description: Statement
  
  There are N children, numbered 1, 2, \ldots, N.
  
  They have decided to share K candies among themselves. Here, for each i (1
  \leq i \leq N), Child i must receive between 0 and a_i candies (inclusive).
  Also, no candies should be left over.
  
  Find the number of ways for them to share candies, modulo 10^9 + 7. Here, two
  ways are said to be different when there exists a child who receives a
  different number of candies.
samples: [{"input": "3 4\n    1 2 3", "output": "5\n    \n\nThere are five ways for the children to share candies, as follows:\n\n  * (0, 1, 3)\n  * (0, 2, 2)\n  * (1, 0, 3)\n  * (1, 1, 2)\n  * (1, 2, 1)\n\nHere, in each sequence, the i-th element represents the number of candies that\nChild i receives.\n\n* * *"}, {"input": "1 10\n    9", "output": "0\n    \n\nThere may be no ways for the children to share candies.\n\n* * *"}, {"input": "2 0\n    0 0", "output": "1\n    \n\nThere is one way for the children to share candies, as follows:\n\n  * (0, 0)\n\n* * *"}, {"input": "4 100000\n    100000 100000 100000 100000", "output": "665683269\n    \n\nBe sure to print the answer modulo 10^9 + 7."}]