#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(x) x.begin(), x.end()

template <typename T1, typename T2> inline void chkmin(T1 &x, const T2 & y) {if (x > y) x = y;}
template <typename T1, typename T2> inline void chkmax(T1 &x, const T2 & y) {if (x < y) x = y;}

const int MOD = 1e9 + 7;

int mul(int a, int b) {
    return (ll) a * b % MOD;
}

int add(int a, int b) {
    a += b;
    if (a >= MOD)
        a -= MOD;
    return a;
}

int sub(int a, int b) {
    a -= b;
    if (a < 0)
        a += MOD;
    return a;
}

int binpow(int a, int n) {
    if (!n) return 1;
    if (n & 1) {
        return mul(a, binpow(a, n - 1));
    }
    else {
        return binpow(mul(a, a), n / 2);
    }
}

int inv(int a) {
    return binpow(a, MOD - 2);
}

const int MAXN = 2e6 + 10;

int fact[MAXN], rfact[MAXN];

void build() {
    fact[0] = rfact[0] = 1;
    for (int i = 1; i < MAXN; i++) {
        fact[i] = mul(fact[i - 1], i);
        rfact[i] = inv(fact[i]);
    }
    //for (int i = 0; i < 10; i++) {
    //    cout << fact[i] << " " << rfact[i] << endl;
    //}
}

int c_n_k(int n, int k) {
    if (min(n, k) <= 0) return 1;
    return mul(fact[n], mul(rfact[k], rfact[n - k]));
}

int r1, r2, c1, c2;

void read() {
    cin >> r1 >> c1 >> r2 >> c2;
} 

/*int get_cnt(int i, int r, int c) {
    int x1 = max(0, i - r);
    int x2 = min(i, c);
    return x2 - x1 + 1;
}
*/
//int dp[100][100];

int get(int r, int c) {
    //cout << "r = " << r << " c = " << c << endl; 
     //int ans = 0;
    //for (int i = 0; i <= r + c; i++) {
        //ans += mul(c_n_k(2 * i - 2, i), get_cnt(i, r, c));
    //    ans += binpow(2, i);
    //    cout << c_n_k(2 * i - 2, i) << endl;
    //}
    /*for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            cout << c_n_k(i, j) << " ";
        }
        cout << endl;
    }*/
    r++;
    c++;
    return c_n_k(r + c, c) - 1;
}

int ans;

void run() {
    /*dp[1][1] = 1;
    for (int i = 1; i < 10; i++) {
        for (int j = 1; j < 10; j++) {
            dp[i][j] += dp[i - 1][j];
            dp[i][j] += dp[i][j - 1];
            cout << dp[i][j] << " ";
        }
        cout << endl;
    }
    cout << endl;
    for (int i = 1; i < 10; i++) {
        for (int j = 1; j < 10; j++) {
            dp[i][j] += dp[i - 1][j];
            dp[i][j] += dp[i][j - 1];
            dp[i][j] -= dp[i - 1][j - 1];
            cout << dp[i][j] << " ";
        }
        cout << endl;
    }*/

    /*cout << endl;
    for (int i = 1; i < 10; i++) {
        for (int j = 1; j < 10; j++) {
            cout << c_n_k(i + j, j) - 1 << " ";
        }
        cout << endl;
    }

    cout << endl;
    */
    /*cout << endl;
    for (int i = 1; i < 10; i++) {
        for (int j = 1; j < 10; j++) {
            cout << get(i, j) << " ";
        }
        cout << endl;
    }*/


    ans = 0;
  //  cout << get(2, 2) << endl;
   // exit(0);
    /*for (int r = 1; r <= 5; r++) {
        for (int c = 1; c <= 5; c++) {
            cout << r << " " << c << " " << get(r, c) << endl;
        }
    }*/
    /*cout << endl;
    cout << get(r2, c2) << endl;
    cout << get(r1 - 1, c2) << endl;
    cout << get(r2, c1 - 1) << endl;
    cout << get(r1 - 1, c1 - 1) << endl;
    cout << endl;
    */
    ans = add(ans, get(r2, c2));
    ans = sub(ans, get(r1 - 1, c2));
    ans = sub(ans, get(r2, c1 - 1));
    ans = add(ans, get(r1 - 1, c1 - 1));
}

void write() {
    cout << ans << endl;
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    build();
    read();
    run();
    write();
    return 0;
}

Measured memory_bytes: 15872