// Slower C++ solution:
#include <bits/stdc++.h>

typedef long long ll;

typedef long double ld;

using namespace std;



ll mod_pow(ll n, ll p, ll mod){

    n %= mod;

    if(p==0) return 1;

    ll res = mod_pow(n*n%mod, p/2, mod);

    if(p%2==1) res = res * n % mod;

    return res;

}



struct combination {

    combination(ll Nmax, ll mod){

        (this -> MOD) = mod;

        (this -> Nmax) = Nmax;

        factorial.resize(Nmax+1, 1);

        inverse_factorial.resize(Nmax+1, 1);

        init_factorial();

    }



    ll calc(ll n, ll r){

        ll ret = (factorial[n]*inverse_factorial[r])%MOD;

        ret = (ret*inverse_factorial[n-r])%MOD;

        return ret;

    }



    private:

        ll MOD, Nmax;

        vector<ll> factorial;

        vector<ll> inverse_factorial;



        void init_factorial(){

            for(ll i=1; i<=Nmax; i++){

                factorial[i] = (factorial[i-1] * i)%MOD;

            }

            inverse_factorial[Nmax] = mod_pow(factorial[Nmax], MOD-2, MOD);

            for(ll i=Nmax-1; i>=1; i--){

                inverse_factorial[i] = (inverse_factorial[i+1]*(i+1))%MOD;

            }

        }

};



int main(){

    int r1, c1, r2, c2;  cin >> r1 >> c1 >> r2 >> c2;

    ll mod = 1e9 + 7;

    combination comb = combination(r2+c2+50, mod);

    ll ans = 0;

    for(int r=r1; r<=r2; r++){

        ll temp = ((c2+1)*comb.calc(c2+r+1, c2+1))%mod;

        temp %= mod;

        temp -= (c1 * comb.calc(c1+r, c1))%mod;

        while(temp<0)

            temp += mod;

        temp %= mod;

        temp *= mod_pow(r+1, mod-2, mod);

        temp %= mod;

        ans += temp;

        ans %= mod;

    }

    cout << ans << endl;

}


// Faster C++ solution for the same problem (measured speedup: 2.352481543654012x):
#include <bits/stdc++.h>

typedef long long ll;

typedef long double ld;

using namespace std;



struct combination {

    combination(ll Nmax, ll mod){

        (this -> MOD) = mod;

        (this -> Nmax) = Nmax;

        factorial.resize(Nmax+1, 1);

        inverse_factorial.resize(Nmax+1, 1);

        init_factorial();

    }



    ll calc(ll n, ll r){

        if(r < 0 || r > n) return 0;

        ll ret = (factorial[n]*inverse_factorial[r])%MOD;

        ret = (ret*inverse_factorial[n-r])%MOD;

        return ret;

    }



    private:

        ll MOD, Nmax;

        vector<ll> factorial;

        vector<ll> inverse_factorial;

        ll mod_pow(ll n, ll p, ll mod){

            n %= mod;

            if(p==0) return 1;

            ll res = mod_pow(n*n%mod, p/2, mod);

            if(p%2==1) res = res * n % mod;

            return res;

        }



        void init_factorial(){

            for(ll i=1; i<=Nmax; i++){

                factorial[i] = (factorial[i-1] * i)%MOD;

            }

            inverse_factorial[Nmax] = mod_pow(factorial[Nmax], MOD-2, MOD);

            for(ll i=Nmax-1; i>=1; i--){

                inverse_factorial[i] = (inverse_factorial[i+1]*(i+1))%MOD;

            }

        }

};



int main(){

    ll r1, c1, r2, c2;

    cin >> r1 >> c1 >> r2 >> c2;

    ll mod = 1e9+7;

    combination comb(r2+c2+10, mod);



    ll ans = 0;

    for(int r = r1; r<=r2; r++){

        ans += comb.calc(r + c2 + 1, r + 1);

        ans -= comb.calc(r + c1, r + 1);

        while(ans < 0) ans += mod;

        ans %= mod;

    }

    cout << ans << endl;

}