// Slower C++ solution:
#include <bits/stdc++.h>



#define rep(i,n) for(int i=0;i<(n);i++)



using namespace std;



class mint{

	static const int MOD=1e9+7;

	int x;

public:

	mint():x(0){}

	mint(long long y){ x=y%MOD; if(x<0) x+=MOD; }



	mint& operator+=(const mint& m){ x+=m.x; if(x>=MOD) x-=MOD; return *this; }

	mint& operator-=(const mint& m){ x-=m.x; if(x<   0) x+=MOD; return *this; }

	mint& operator*=(const mint& m){ x=1LL*x*m.x%MOD; return *this; }

	mint& operator/=(const mint& m){ return *this*=inverse(m); }

	mint operator+(const mint& m)const{ return mint(*this)+=m; }

	mint operator-(const mint& m)const{ return mint(*this)-=m; }

	mint operator*(const mint& m)const{ return mint(*this)*=m; }

	mint operator/(const mint& m)const{ return mint(*this)/=m; }



	friend mint inverse(const mint& m){

		int a=m.x,b=MOD,u=1,v=0;

		while(b>0){ int t=a/b; a-=t*b; swap(a,b); u-=t*v; swap(u,v); }

		return u;

	}



	friend istream& operator>>(istream& is,mint& m){ long long t; is>>t; m=mint(t); return is; }

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

	int to_int()const{ return x; }

};



mint fact(int n){

	static vector<mint> memo={1};

	if(memo.size()<=n){

		int k=memo.size();

		memo.resize(n+1);

		for(;k<=n;k++) memo[k]=memo[k-1]*k;

	}

	return memo[n];

}



mint fact_inverse(int n){

	static vector<mint> memo={1};

	if(memo.size()<=n){

		int k=memo.size();

		memo.resize(n+1);

		memo[n]=inverse(fact(n));

		for(int i=n;i>k;i--) memo[i-1]=memo[i]*i;

	}

	return memo[n];

}



mint choose(int n,int k,int type=0){

	if(k<0 || n<k) return 0;

	if(type==0){

		return fact(n)*fact_inverse(k)*fact_inverse(n-k);

	}

	else{

		if(k>n-k) k=n-k;

		mint res=fact_inverse(k);

		rep(i,k) res*=n-i;

		return res;

	}

}



mint f(int r,int c){

	mint res=0;

	rep(i,r+1) res+=choose(i+c+1,c);

	return res;

}



int main(){

	int r1,c1,r2,c2; scanf("%d%d%d%d",&r1,&c1,&r2,&c2);

	cout<<f(r2,c2)-f(r1-1,c2)-f(r2,c1-1)+f(r1-1,c1-1)<<'\n';

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.2822664893240758x):
#include <bits/stdc++.h>



#define rep(i,n) for(int i=0;i<(n);i++)



using namespace std;



class mint{

	static const int MOD=1e9+7;

	int x;

public:

	mint():x(0){}

	mint(long long y){ x=y%MOD; if(x<0) x+=MOD; }



	mint& operator+=(const mint& m){ x+=m.x; if(x>=MOD) x-=MOD; return *this; }

	mint& operator-=(const mint& m){ x-=m.x; if(x<   0) x+=MOD; return *this; }

	mint& operator*=(const mint& m){ x=1LL*x*m.x%MOD; return *this; }

	mint& operator/=(const mint& m){ return *this*=inverse(m); }

	mint operator+(const mint& m)const{ return mint(*this)+=m; }

	mint operator-(const mint& m)const{ return mint(*this)-=m; }

	mint operator*(const mint& m)const{ return mint(*this)*=m; }

	mint operator/(const mint& m)const{ return mint(*this)/=m; }



	friend mint inverse(const mint& m){

		int a=m.x,b=MOD,u=1,v=0;

		while(b>0){ int t=a/b; a-=t*b; swap(a,b); u-=t*v; swap(u,v); }

		return u;

	}



	friend istream& operator>>(istream& is,mint& m){ long long t; is>>t; m=mint(t); return is; }

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

	int to_int()const{ return x; }

};



mint fact(int n){

	static vector<mint> memo={1};

	if(memo.size()<=n){

		int k=memo.size();

		memo.resize(n+1);

		for(;k<=n;k++) memo[k]=memo[k-1]*k;

	}

	return memo[n];

}



mint fact_inverse(int n){

	static vector<mint> memo={1};

	if(memo.size()<=n){

		int k=memo.size();

		memo.resize(n+1);

		memo[n]=inverse(fact(n));

		for(int i=n;i>k;i--) memo[i-1]=memo[i]*i;

	}

	return memo[n];

}



mint choose(int n,int k,int type=0){

	if(k<0 || n<k) return 0;

	if(type==0){

		return fact(n)*fact_inverse(k)*fact_inverse(n-k);

	}

	else{

		if(k>n-k) k=n-k;

		mint res=fact_inverse(k);

		rep(i,k) res*=n-i;

		return res;

	}

}



mint f(int r,int c){

	mint res=0;

	for(int i=r;i>=0;i--) res+=choose(i+c+1,c);

	return res;

}



int main(){

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

	cout<<f(r2,c2)-f(r1-1,c2)-f(r2,c1-1)+f(r1-1,c1-1)<<'\n';

	return 0;

}