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

const int inf = 1e9;
const ll linf = 1e18;

template <ll mod> class modint
{
public:
    modint(ll value = 0) : _value(value >= 0 ? value % mod : (value % mod) + mod) {}

    modint operator+() const { return *this; }
    modint operator-() const { return modint(-_value); }

    modint &operator+=(const modint &rhs) {
        if ((_value += rhs._value) >= mod) _value -= mod;
        return *this;
    }
    modint &operator-=(const modint &rhs) {
        if ((_value += mod - rhs._value) >= mod) _value -= mod;
        return *this;
    }
    modint &operator*=(const modint &rhs) {
        (_value *= rhs._value) %= mod;
        return *this;
    }
    modint &operator/=(const modint &rhs) {
        *this *= rhs.inv();
        return *this;
    }
    modint operator+(const modint &rhs) const { return modint(*this) += rhs; }
    modint operator-(const modint &rhs) const { return modint(*this) -= rhs; }
    modint operator*(const modint &rhs) const { return modint(*this) *= rhs; }
    modint operator/(const modint &rhs) const { return modint(*this) /= rhs; }

    modint operator++() { *this += 1; return *this; }
    modint operator--() { *this -= 1; return *this; }
    modint operator++(int) { modint tmp = *this; ++*this; return tmp; }
    modint operator--(int) { modint tmp = *this; --*this; return tmp; }

    bool operator==(const modint &rhs) const { return _value == rhs._value; }
    bool operator!=(const modint &rhs) const { return _value != rhs._value; }

    modint inv() const {
        ll a = _value, b = mod, u = 1LL, v = 0LL;
        while (b > 0) {
            ll tmp = a / b;
            a -= tmp * b; swap(a, b);
            u -= tmp * v; swap(u, v);
        }
        return modint(u);
    }

    modint pow(ll n) const {
        modint e = *this, res = 1;
        while (n) {
            if (n & 1) res *= e;
            e *= e, n >>= 1;
        }
        return res;
    }

    friend ostream &operator<<(ostream &os, const modint &m) {
        os << m._value;
        return os;
    }

    friend istream &operator>>(istream &is, modint &m) {
        ll in;
        is >> in;
        m = modint(in);
        return is;
    }

private:
    ll _value;
};
using mint = modint<1000000007>;

class Combination
{
private:
    vector<mint> _fact, _inv_fact;
    
public:
    Combination(int size) : _fact(size + 1), _inv_fact(size + 1) {
        _fact[0] = 1;
        for (int i = 1; i <= size; i++) _fact[i] = _fact[i-1] * i;
        _inv_fact[size] = _fact[size].inv();
        for (int i = size - 1; i >= 0; i--) _inv_fact[i] = _inv_fact[i+1] * (i+1);
    }

    mint fact(int k) const {return _fact[k];}
    mint inv_fact(int k) const {return _inv_fact[k];}

    mint P(int n, int r) {
        if (r < 0 || n < r) return 0;
        else return fact(n) * inv_fact(n - r);
    }

    mint C(int n, int r) {
        if (r < 0 || n < r) return 0;
        else return fact(n) * inv_fact(r) * inv_fact(n - r);
    }

    mint H(int n, int r) {
        if (n < 0 || r < 0) return 0;
        else return r == 0 ? 1 : C(n + r - 1, r);
    }
};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

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

    Combination comb(r2 + c2 + 2);

    auto f = [&](int r, int c) {
        return comb.C(r + c + 2, r + 1) - 1;
    };

    mint ans = f(r2, c2) - f(r2, c1 - 1) - f(r1 - 1, c2) + f(r1 - 1, c1 - 1);

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 31488