/***********************************************************
	When you are inspired by passion 
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

					huzaifa242©

***********************************************************/
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define MAX 2000005
#define x first 
#define y second

int seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline int rnd(int l=0,int r=INT_MAX)
{return uniform_int_distribution<int>(l,r)(rng);}

template <typename T,typename G>
ostream& operator << (ostream& out, const pair<T,G> &a) 
{return out<<"( "<<a.x<<", "<<a.y<<")";}

template <typename T>
ostream& operator << (ostream& out, const vector<T> &a) 
{out<<"[ ";for(const auto &i:a)out<<i<<", ";return out<<"]"<<endl;}

template <typename T>
ostream& operator << (ostream& out, const set<T> &a) 
{out<<"{ ";for(const auto &i:a)out<<i<<", ";return out<<"}"<<endl;}

template <typename T,typename G>
ostream& operator << (ostream& out, const map<T,G> &a) 
{out<<"< ";for(const auto &i:a)out<<i<<", ";return out<<">"<<endl;}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<"[ ";for(size_t i=0;i<N;++i)out<<a[i]<<", ";out <<"]"<<endl;return out;}

void debug_out(){cerr<<endl;} 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T)
{cerr<<(H)<<" ";debug_out(T...);}
 
#ifdef LOCAL
#define debug(...) cerr<<"#"<<#__VA_ARGS__<<":\n",debug_out(__VA_ARGS__)
#else
#define debug(...) 24
#endif

const int mod = 1000000007;
int md(int x,int mdo=mod){
	while(x<0)
		x+=mdo;
	return x%mdo;
}
int multi(int a, int b, int mdo=mod){
	int pro=0;
	a=md(a,mdo);
	while(b){
		if(b&1)
			pro=md(md(pro,mdo)+md(a,mdo),mdo);
		a=md(a*2,mdo);
		b>>=1;
	}
	return pro;
}
int pwr(int a,int n,int mdo=mod){
	if(n==0)
		return md(1,mdo);
	else if(n==1)
		return md(a,mdo);
	int x=pwr(a,n/2,mdo);
	if(max(x,md(a,mdo))< int(1e9))
		x=md(x*x,mdo);
	else
		x=md(multi(x,x,mdo),mdo);
	if(n&1){
		if(max(x,md(a,mdo))< int(1e9))
			x=md(x*md(a,mdo),mdo);
		else
			x=md(multi(x,md(a,mdo),mdo),mdo);
	}
	return x;
}
int ge(int a, int b, int *x, int *y){
	if (a == 0){
		*x = 0, *y = 1;
		return b;
	}
	int x1, y1;
	int gcd = ge(b%a, a, &x1, &y1);
	*x = y1 - (b/a) * x1;
	*y = x1;
	return gcd;
}
int  modinv(int a, int m=mod){
	int x, y;
	int g = ge(a, m, &x, &y);
	int p = (x%m + m) % m;
	return p;
}
vector<int> fct(MAX),ifct(MAX);

void pre(){
	int i;
	fct[0]=1;
	for(i=1;i<MAX;i++){
		fct[i]=md(fct[i-1]*i);
	}
	ifct[MAX-1]=modinv(fct[MAX-1]);
	for(i=MAX-1;i>0;i--){
		ifct[i-1]=md(ifct[i]*i);
	}
}

int ncr(int n, int r){
	if(n<0 || r<0 || n<r)
		return 0;
	return md(fct[n]*md(ifct[r]*ifct[n-r]));
}

signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);
	int i,j;
	pre();
	int x1,y1,x2,y2;
	cin>>x1>>y1>>x2>>y2;
	int ans=ncr(x1+y1,x1);
	for(i=x1+1;i<=x2;i++){
		ans=md(ans+ncr(i+y2,y2));
	}
	for(i=y1+1;i<=y2;i++){
		ans=md(ans+ncr(i+x2,x2));
	}
	cout<<ans<<"\n";
	return 0;
}


Measured memory_bytes: 31488