output_description: Print the sum of f(i, j) modulo (10^9+7).
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      r_1 c_1 r_2 c_2
attempt: class Combination:
      """
      SIZEが10^6程度以下の二項係数を何回も呼び出したいときに使う
      使い方:
      comb = Combination(SIZE, MOD)
      comb(10, 3) => 120
      """
  
      def __init__(self, N, MOD=10**9 + 7):
          self.MOD = MOD
          self.fact, self.inv = self._make_factorial_list(N)
  
      def __call__(self, n, k):
          if k < 0 or k > n:
              return 0
          res = self.fact[n] * self.inv[k] % self.MOD
          res = res * self.inv[n - k] % self.MOD
          return res
  
      def _make_factorial_list(self, N):
          fact = [1] * (N + 1)
          inv = [1] * (N + 1)
          MOD = self.MOD
          for i in range(1, N + 1):
              fact[i] = (fact[i - 1] * i) % MOD
          inv[N] = pow(fact[N], MOD - 2, MOD)
          for i in range(N, 0, -1):
              inv[i - 1] = (inv[i] * i) % MOD
          return fact, inv
  
  
  if __name__ == "__main__":
      r1, c1, r2, c2 = map(int, input().split())
      mod = 10**9 + 7
      comb = Combination(2 * 10**6 + 10, mod)
  
      def f(r, c):
          return comb(r + c + 2, r + 1)
  
      CD = (f(r2, c2) - f(r2, c1 - 1) + mod) % mod
      C = (f(r1 - 1, c2) - f(r1 - 1, c1 - 1) + mod) % mod
      ans = (CD - C + mod) % mod
      print(ans)
  
problem_description: Statement
  
  Snuke is standing on a two-dimensional plane. In one operation, he can move by
  1 in the positive x-direction, or move by 1 in the positive y-direction.
  
  Let us define a function f(r, c) as follows:
  
    * f(r,c) :=  (The number of paths from the point (0, 0) to the point (r, c) that Snuke can trace by repeating the operation above)
  
  Given are integers r_1, r_2, c_1, and c_2. Find the sum of f(i, j) over all
  pair of integers (i, j) such that r_1 ≤ i ≤ r_2 and c_1 ≤ j ≤ c_2, and compute
  this value modulo (10^9+7).
samples: [{"input": "1 1 2 2", "output": "14\n    \n\nFor example, there are two paths from the point (0, 0) to the point (1, 1):\n(0,0) \u2192 (0,1) \u2192 (1,1) and (0,0) \u2192 (1,0) \u2192 (1,1), so f(1,1)=2.\n\nSimilarly, f(1,2)=3, f(2,1)=3, and f(2,2)=6. Thus, the sum is 14.\n\n* * *"}, {"input": "314 159 2653 589", "output": "602215194"}]