#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#include <algorithm>
#include <bitset>
#include <complex>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#include <cassert>
#include <functional>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

template<typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template<typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}
#endif

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 200010

template<int M = mod>
struct ModInt {
  using ll = long long;
  ll val;

  ModInt(ll x = 0): val(x >= 0 ? x % M : (x % mod + mod) % mod) {}

  explicit operator bool() const { return val != 0; }

  ModInt operator+() const { return *this; }
  ModInt operator-() const { return ModInt(-val); }

  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; }

  bool operator==(const ModInt &rhs) const { return val == rhs.val; }
  bool operator!=(const ModInt &rhs) const { return val != rhs.val; }
  bool operator<(const ModInt &rhs) const { return val < rhs.val; }
  bool operator>(const ModInt &rhs) const { return val > rhs.val; }
  bool operator<=(const ModInt &rhs) const { return val <= rhs.val; }
  bool operator>=(const ModInt &rhs) const { return val >= rhs.val; }

  ModInt operator++() { return *this += 1; }
  ModInt operator--() { return *this -= 1; }
  ModInt operator++(int) { return ++*this, *this - 1; }
  ModInt operator--(int) { return --*this, *this + 1; }

  ModInt &operator+=(const ModInt &rhs) {
    val += rhs.val;
    if (val >= M) val -= M;
    return *this;
  }
  ModInt &operator-=(const ModInt &rhs) {
    val -= rhs.val;
    if (val < 0) val += M;
    return *this;
  }
  ModInt &operator*=(const ModInt &rhs) {
    val = val * rhs.val % M;
    return *this;
  }
  ModInt &operator/=(ModInt rhs) {
    for (int exp = M - 2; exp; exp /= 2) {
      if (exp % 2) *this *= rhs;
      rhs *= rhs;
    }
    return *this;
  }

  friend ostream &operator<<(ostream &os, const ModInt &rhs) {
    return os << rhs.val;
  }

  friend istream &operator>>(istream &is, ModInt &rhs) {
    ll x;
    is >> x;
    rhs = ModInt(x);
    return is;
  }
};


ll calc(ll c, ll r) {
  ModInt<mod> sum = 0, x = 1;

  for (int i = 1; i <= r; i++) {
    x *= c + i - 1;
    x /= i;
    sum += x;
  }

  return sum.val;
}

int main() {
  int C1, R1, C2, R2;

  cin >> C1 >> R1 >> C2 >> R2;
  C2++;
  R2++;

  ModInt<mod> ans = 0;

  ans += calc(C2, R2) + calc(C1, R1);
  ans -= calc(C1, R2) + calc(C2, R1);

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256