# -*- coding: utf-8 -*-

import sys

sys.setrecursionlimit(10**9)

INF=10**18

MOD=10**9+7

input=lambda: sys.stdin.readline().rstrip()

YesNo=lambda b: bool([print('Yes')] if b else print('No'))

YESNO=lambda b: bool([print('YES')] if b else print('NO'))

int1=lambda x:int(x)-1



def main():

    r,c,rr,cc=map(int,input().split())

    def COMinit(n,MOD):

        fac,finv,inv=[0]*max(2,n+1),[0]*max(2,n+1),[0]*max(2,n+1)

        fac[0]=fac[1]=1

        finv[0]=finv[1]=1

        inv[1]=1

        for i in range(2,(n+1)):

            fac[i]=fac[i-1]*i%MOD

            inv[i]=MOD-inv[MOD%i]*(MOD//i)%MOD

            finv[i]=finv[i-1]*inv[i]%MOD

        return fac,finv,inv

    

    fac,finv,inv=COMinit(rr+cc+10,MOD)

    

    def COM(n, k, MOD=MOD):

        if n<k or n<0 or k<0:

            return 0

        return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD

    

    ans=0

    for i in range(c,cc+1):

        ans+=COM(rr+i+1,i+1)-COM(r+i,i+1)

        ans%=MOD

    print(ans)



if __name__ == '__main__':

    main()

# -*- coding: utf-8 -*-

import sys

sys.setrecursionlimit(10**9)

INF=10**18

MOD=10**9+7

input=lambda: sys.stdin.readline().rstrip()

YesNo=lambda b: bool([print('Yes')] if b else print('No'))

YESNO=lambda b: bool([print('YES')] if b else print('NO'))

int1=lambda x:int(x)-1



def main():

    r,c,rr,cc=map(int,input().split())

    def COMinit(n,MOD):

        fac,finv,inv=[0]*max(2,n+1),[0]*max(2,n+1),[0]*max(2,n+1)

        fac[0]=fac[1]=1

        finv[0]=finv[1]=1

        inv[1]=1

        for i in range(2,(n+1)):

            fac[i]=fac[i-1]*i%MOD

            inv[i]=MOD-inv[MOD%i]*(MOD//i)%MOD

            finv[i]=finv[i-1]*inv[i]%MOD

        return fac,finv,inv

    

    fac,finv,inv=COMinit(rr+cc+10,MOD)

    

    def COM(n, k, MOD=MOD):

        if n<k or n<0 or k<0:

            return 0

        return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD

    

    ans=COM(rr+cc+2,rr+1)-COM(rr+c+1,c)-COM(r+cc+1,r)+COM(r+c,r)

    ans%=MOD

    print(ans)



if __name__ == '__main__':

    main()

# -*- coding: utf-8 -*-
import sys

sys.setrecursionlimit(10**9)
INF = 10**18
MOD = 10**9 + 7
input = lambda: sys.stdin.readline().rstrip()
YesNo = lambda b: bool([print("Yes")] if b else print("No"))
YESNO = lambda b: bool([print("YES")] if b else print("NO"))
int1 = lambda x: int(x) - 1


def main():
    r, c, rr, cc = map(int, input().split())

    def COMinit(n, MOD):
        fac, finv, inv = [0] * max(2, n + 1), [0] * max(2, n + 1), [0] * max(2, n + 1)
        fac[0] = fac[1] = 1
        finv[0] = finv[1] = 1
        inv[1] = 1
        for i in range(2, (n + 1)):
            fac[i] = fac[i - 1] * i % MOD
            inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD
            finv[i] = finv[i - 1] * inv[i] % MOD
        return fac, finv, inv

    fac, finv, inv = COMinit(rr + cc + 10, MOD)

    def COM(n, k, MOD=MOD):
        if n < k or n < 0 or k < 0:
            return 0
        return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD

    ans = 0
    for i in range(c, cc + 1):
        ans += COM(rr + i + 1, i + 1) - COM(r + i, i + 1)
        ans %= MOD
    print(ans)


if __name__ == "__main__":
    main()

# -*- coding: utf-8 -*-
import sys

sys.setrecursionlimit(10**9)
INF = 10**18
MOD = 10**9 + 7
input = lambda: sys.stdin.readline().rstrip()
YesNo = lambda b: bool([print("Yes")] if b else print("No"))
YESNO = lambda b: bool([print("YES")] if b else print("NO"))
int1 = lambda x: int(x) - 1


def main():
    r, c, rr, cc = map(int, input().split())

    def COMinit(n, MOD):
        fac, finv, inv = [0] * max(2, n + 1), [0] * max(2, n + 1), [0] * max(2, n + 1)
        fac[0] = fac[1] = 1
        finv[0] = finv[1] = 1
        inv[1] = 1
        for i in range(2, (n + 1)):
            fac[i] = fac[i - 1] * i % MOD
            inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD
            finv[i] = finv[i - 1] * inv[i] % MOD
        return fac, finv, inv

    fac, finv, inv = COMinit(rr + cc + 10, MOD)

    def COM(n, k, MOD=MOD):
        if n < k or n < 0 or k < 0:
            return 0
        return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD

    ans = (
        COM(rr + cc + 2, rr + 1)
        - COM(rr + c + 1, c)
        - COM(r + cc + 1, r)
        + COM(r + c, r)
    )
    ans %= MOD
    print(ans)


if __name__ == "__main__":
    main()

-    ans = 0 -    for i in range(c, cc + 1): -        ans += COM(rr + i + 1, i + 1) - COM(r + i, i + 1) -        ans %= MOD +    ans = ( +        COM(rr + cc + 2, rr + 1) +        - COM(rr + c + 1, c) +        - COM(r + cc + 1, r) +        + COM(r + c, r) +    ) +    ans %= MOD