private const val MOD:Long=1e9.toLong()+7

private class Comb(){
    val n=2e6.toInt()+2
    var fact=LongArray(n+1)
    var factinv=LongArray(n+1)
    init {
        fact[0]=1L
        for(i in 1 until n+1){
            fact[i]=fact[i-1]*i%MOD
        }
        factinv[n]=pow(fact[n], MOD-2)
        for(i in n downTo 1){
            factinv[i-1]=factinv[i]*i%MOD
        }
    }
    private fun pow(base:Long, exp:Long):Long{
        if(exp==0L) return 1L
        var ans=pow(base, exp shr 1)
        ans=ans*ans%MOD
        if (exp and 1L==0L) return ans
        return ans*base%MOD
    }
    fun comb(n:Int, k:Int):Long{
        return fact[n] * factinv[n-k]%MOD * factinv[k]%MOD
    }
}

fun main(args: Array<String>) {
    var (r1, c1, r2, c2)= readLine()!!.split(" ").map { it.toInt() }
    var ans:Long=0L
    var cb=Comb()
    ans+=cb.comb(r2+1+c2+1, r2+1)
    ans=ans%MOD
    ans-=cb.comb(r2+1+c1, r2+1)
    ans=(ans+MOD)%MOD
    ans-=cb.comb(r1+c2+1, c2+1)
    ans=(ans+MOD)%MOD
    ans+=cb.comb(r1+c1, r1)
    ans=ans%MOD
    println(ans)
}
