import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}
import scala.collection.mutable.{Map, Stack, Queue, PriorityQueue, Set}

object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)

  val r1, c1, r2, c2 = in.next().toInt

  //
  val MOD = 1e9.toInt + 7
  val mc = new ModComb(1e6.toInt + 100, MOD)

  def calc(r: Int, c: Int): Long = mc.comb(r+c+2, c+1) - 1

  var ans = 0L
  ans += calc(r2, c2)
  ans += calc(r1-1, c1-1)
  ans %= MOD

  ans += MOD - calc(r2, c1-1)
  ans %= MOD

  ans += MOD - calc(r1-1, c2)
  ans %= MOD

  println(ans)
}

class ModComb(maxNum: Int, mod: Long) {

  private def repeatSquares(x: Long, n: Long): Long = {
    def func(x: Long, n: Long): Long = {
      if(n == 0)
        1
      else if(n % 2 == 0)
        func(x*x % mod, n/2)
      else
        (x * func(x*x % mod, n/2)) % mod
    }

    if (x == 0 && n != 0) 0
    else func(x, n)
  }

  private val fact = new Array[Long](maxNum + 1)

  fact(0) = 1
  for (i <- 1 to maxNum)
    fact(i) = (i * fact(i-1)) % mod

  private val factInv = new Array[Long](maxNum + 1)

  factInv(maxNum) = repeatSquares(fact(maxNum), mod-2)
  for (i <- (1 to maxNum).reverse)
    factInv(i-1) = (i * factInv(i)) % mod


  // nCk
  def comb(n: Int, k: Int): Long = {
    val numer = fact(n)
    val denom = (factInv(n-k) * factInv(k)) % mod

    (numer * denom) % mod
  }

}


class InputReader(stream: InputStream) {
  private[this] val reader = new BufferedReader(new InputStreamReader(stream))
  private[this] var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}
