#include <bits/stdc++.h>
using namespace std;

#define int long long
typedef pair<int, int> P;
#define mod 1000000007
#define INF (1LL<<60)
 
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
#define YES puts("YES")
#define Yes puts("Yes")
#define NO  puts("NO")
#define No  puts("No")
#define ALL(v) (v).begin(), (v).end()
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
 
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
 
 
#if 1
//-------------
// DUMPマクロ
// https://www.creativ.xyz/dump-cpp-652/
 
// vector
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    for (T& x : vec) is >> x;
    return is;
}
// pair
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
// vector
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
// map
template <typename T, typename U>
ostream& operator<<(ostream& os, map<T, U>& map_var) {
    os << "{";
    repi(itr, map_var) {
        os << *itr;
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
// set
template <typename T>
ostream& operator<<(ostream& os, set<T>& set_var) {
    os << "{";
    repi(itr, set_var) {
        os << *itr;
        itr++;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
 
#define DUMPOUT cerr
 
void dump_func() {
    DUMPOUT << endl;
}
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&& ... tail) {
    DUMPOUT << head;
    if (sizeof...(Tail) > 0) {
        DUMPOUT << ", ";
    }
    dump_func(std::move(tail)...);
}
#ifdef DEBUG
#define DEB
#define dump(...)                                                              \
    DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
            << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
            << endl                                                            \
            << "    ",                                                         \
        dump_func(__VA_ARGS__)
#else
#define DEB if (false)
#define dump(...)
#endif
#endif

// ax+by=1の解
int extgcd(int a, int b, int& x, int& y){
    int d = a;
    if (b != 0){
        d = extgcd(b, a%b, y, x);
        y -= (a / b)*x;
    }
    else{
        x = 1; y = 0;
    }
    return d;
}

// mod mでのaの逆数
int mod_inv(int a, int m){
    int x, y;
    extgcd(a, m, x, y);
    return (m + x%m) % m;
}

// nの階乗 mod p
int factorial(int n, int p){
    int r = 1;
    for (int i = 1; i <= n; i++)
        r = (r*i) % p;
    return r;
}

// nPr mod p
int permutation(int n, int r, int p){
    int a = 1;
    for (int i = n-r+1; i <= n; i++)
        a = (a*i) % p;
    return a;
}

// nCr mod p
int combination(int n, int r, int p){
    if (r == 0 || r == n) return 1;
    if (r > n) return 0;
    if (r > n / 2) r = n - r;
    int numerator = permutation(n, r, p);
    int denominator = factorial(r, p) % p;
    int inv = mod_inv(denominator, p);
    return (numerator * inv) % p;
}

int calc(int a, int b){
    int r = 0;
    r = ((a+2) *combination(a+b+2, a+2, mod) % mod + mod )- b - 1;
    r *= mod_inv(b+1, mod);
    r %= mod;
    return (r+mod-1)%mod;
}

void solve(){
    int r1, c1, r2, c2;
    cin >> r1 >> c1 >> r2 >> c2;
    
    dump(calc(2,2));
    
    int ans = calc(r2,c2) + 2*mod - calc(r2,c1-1) - calc(r1-1,c2) + calc(r1-1, c1-1);
    cout << ans % mod<< endl;
}

signed main(){
    cout << fixed << setprecision(18);
    cerr << fixed << setprecision(18);
    solve();
}


Measured memory_bytes: 256