output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      A B
attempt: from numpy import *
  
  A, B = map(int, input().split())
  M = 10**9 + 7
  U = 2001
  C = zeros((U, U), int64)
  C[0, 0] = 1
  for n in range(1, U):
      C[n, 1:] += C[n - 1, :-1]
      C[n, :-1] += C[n - 1, :-1]
      C[n] %= M
  S = zeros_like(C)
  S[0] = 1
  S[1:] = (C[:-1].cumsum(axis=1) % M).cumsum(axis=1) % M
  print(sum(C[B - 1, k] * (sum(S[k, : A - k + 1]) % M) % M for k in range(A + 1)))
  
problem_description: Statement
  
  A + B balls are arranged in a row. The leftmost A balls are colored red, and
  the rightmost B balls are colored blue.
  
  You perform the following operation:
  
    * First, you choose two integers s, t such that 1 \leq s, t \leq A + B.
    * Then, you repeat the following step A + B times: In each step, you remove the first ball or the s-th ball (if it exists) or the t-th ball (if it exists, all indices are 1-based) from left in the row, and give it to Snuke.
  
  In how many ways can you give the balls to Snuke? Compute the answer modulo
  10^9 + 7.
  
  Here, we consider two ways to be different if for some k, the k-th ball given
  to Snuke has different colors. In particular, the choice of s, t doesn't
  matter. Also, we don't distinguish two balls of the same color.
samples: [{"input": "3 3", "output": "20\n    \n\nThere are 20 ways to give 3 red balls and 3 blue balls. It turns out that all\nof them are possible.\n\nHere is an example of the operation (`r` stands for red, `b` stands for blue):\n\n  * You choose s = 3, t = 4.\n  * Initially, the row looks like `rrrbbb`.\n  * You remove 3rd ball (`r`) and give it to Snuke. Now the row looks like `rrbbb`.\n  * You remove 4th ball (`b`) and give it to Snuke. Now the row looks like `rrbb`.\n  * You remove 1st ball (`r`) and give it to Snuke. Now the row looks like `rbb`.\n  * You remove 3rd ball (`b`) and give it to Snuke. Now the row looks like `rb`.\n  * You remove 1st ball (`r`) and give it to Snuke. Now the row looks like `b`.\n  * You remove 1st ball (`b`) and give it to Snuke. Now the row is empty.\n\nThis way, Snuke receives balls in the order `rbrbrb`.\n\n* * *"}, {"input": "4 4", "output": "67\n    \n\nThere are 70 ways to give 4 red balls and 4 blue balls. Among them, only\n`bbrrbrbr`, `brbrbrbr`, and `brrbbrbr` are impossible.\n\n* * *"}, {"input": "7 9", "output": "7772\n    \n\n* * *"}, {"input": "1987 1789", "output": "456315553"}]