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

//repetition
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

template <typename T1, typename T2> 
inline bool chmax(T1 &a, T2 b) {
  return a < b && (a = b, true);
}

template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {
  return a > b && (a = b, true);
}

#define MOD (long)(1e9 + 7)

long long modPow(long long x, long long n){
  if(n == 0) return 1;
  if(n % 2 == 0) {
    long long sqrtX = modPow(x,n/2);
    return sqrtX * sqrtX % MOD ;
  }else{
    return x * modPow(x,n-1) % MOD;
  }
}

long long kaizyou(long long x){
  long long res = 1;
  for(int i = 1; i <= x; i++){
    res = (res * i) % MOD;
  }
  return res;
}
//* Mod int
const int mod = 1000000007;
struct mint {
  ll x;
  mint():x(0){}
  mint(ll x):x((x%mod+mod)%mod){}
  // mint(ll x):x(x){}
  mint& fix() { x = (x%mod+mod)%mod; return *this;}
  mint operator-() const { return mint(0) - *this;}
  mint& operator+=(const mint& a){ if((x+=a.x)>=mod) x-=mod; return *this;}
  mint& operator-=(const mint& a){ if((x+=mod-a.x)>=mod) x-=mod; return *this;}
  mint& operator*=(const mint& a){ (x*=a.x)%=mod; return *this;}
  mint operator+(const mint& a)const{ return mint(*this) += a;}
  mint operator-(const mint& a)const{ return mint(*this) -= a;}
  mint operator*(const mint& a)const{ return mint(*this) *= a;}
  bool operator<(const mint& a)const{ return x < a.x;}
  bool operator==(const mint& a)const{ return x == a.x;}
};
istream& operator>>(istream&i,mint&a){i>>a.x;return i;}
ostream& operator<<(ostream&o,const mint&a){o<<a.x;return o;}
typedef vector<mint> vm;
typedef vector<vm> vvm;
//*/

mint modCombi(long long a, long long b){
  if(b > a/2) return modCombi(a,a-b);
  mint res =  ((kaizyou(a) * modPow(kaizyou(b),MOD - 2)) % MOD)* modPow(kaizyou(a-b),MOD - 2) % MOD;
  return res;
}



mint f(ll i, ll j){
  return modCombi(i+j,j);
}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  VLL r(2),c(2);
  cin >> r[0] >> c[0] >> r[1] >> c[1];

  mint ans =0;
  // FOR(i,r[0],r[1]+1) FOR(j,c[0],c[1]+1) ans += f(i,j);
  // mint tmp1 = 0;
  // FOR(i,0,r[1]+1) FOR(j,0,c[1]+1) tmp1 += f(i,j);
  // cout << tmp1 << " " << modCombi(r[1]+c[1]+2,c[1]+1) << endl;

  // cout << modCombi(r[1]+c[1]+2,c[1]+1)-1 << endl;
  // cout << modCombi(r[1]+c[0]+2,r[1]+1)-1 << endl;
  // cout << modCombi(r[0]+c[1]+2,r[0]+1)-1 << endl;
  // cout << modCombi(r[0]+c[0]+2,r[0]+1)-1 << endl;

  ans += modCombi(r[1]+c[1]+2,r[1]+1)-1;
  r[0]--,c[0]--;
  ans -= modCombi(r[1]+c[0]+2,r[1]+1)-1 ;
  ans -= modCombi(r[0]+c[1]+2,r[0]+1)-1 ;
  ans += modCombi(r[0]+c[0]+2,r[0]+1)-1 ;

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


Measured memory_bytes: 256