output_description: Print the answer.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N A B C
attempt: def inverse(k):
      return fast_pow(k, MOD - 2)
  
  
  def comb(n, k):
      return FACT[n] * INVERSE_FACT[n - k] * INVERSE_FACT[k] % MOD
  
  
  def fast_pow(x, y):
      if y == 0:
          return 1
      p = fast_pow(x, y // 2) % MOD
      p = p * p % MOD
      if y % 2:
          p = p * x % MOD
      return p
  
  
  MOD = 1000000007
  
  n, a, b, c = map(int, input().split())
  
  FACT = [0] * (n + 1)
  INVERSE_FACT = [0] * (n + 1)
  
  FACT[0] = 1
  INVERSE_FACT[0] = 1
  for i in range(1, n + 1):
      FACT[i] = FACT[i - 1] * i % MOD
      INVERSE_FACT[i] = inverse(FACT[i])
  
  ans = 0
  if b % 2 != 0:
      print(0)
      exit()
  
  for y in range(0, min(a + 1, c + 1)):
      for z in range(0, (c - y) // 3 + 1):
          x = a - y
          rest3 = c - y - 3 * z
  
          cur_ans = FACT[x + y + z] * INVERSE_FACT[x] % MOD
          cur_ans = cur_ans * INVERSE_FACT[y] % MOD
          cur_ans = cur_ans * INVERSE_FACT[z] % MOD
          cur_ans = cur_ans * comb(x + y + z + 1 + b // 2 - 1, b // 2) % MOD
          cur_ans = cur_ans * comb(b // 2 + rest3 - 1, rest3) % MOD
  
          ans = (ans + cur_ans) % MOD
  
  print(ans)
  
problem_description: Statement
  
  Consider all integers between 1 and 2N, inclusive. Snuke wants to divide these
  integers into N pairs such that:
  
    * Each integer between 1 and 2N is contained in exactly one of the pairs.
    * In exactly A pairs, the difference between the two integers is 1.
    * In exactly B pairs, the difference between the two integers is 2.
    * In exactly C pairs, the difference between the two integers is 3.
  
  Note that the constraints guarantee that N = A + B + C, thus no pair can have
  the difference of 4 or more.
  
  Compute the number of ways to do this, modulo 10^9+7.
samples: [{"input": "3 1 2 0", "output": "2\n    \n\nThere are two possibilities: 1-2, 3-5, 4-6 or 1-3, 2-4, 5-6.\n\n* * *"}, {"input": "600 100 200 300", "output": "522158867"}]