import std.stdio, std.conv, std.string, std.array, std.range, std.algorithm, std.container;
import std.math, std.random, std.bigint, std.datetime, std.format;
void main(string[] args){ if(args.length > 1) if(args[1] == "-debug") DEBUG = 1; solve(); }
void log()(){ writeln(""); } void log(T, A ...)(T t, lazy A a){ if(DEBUG) write(t, " "), log(a); } bool DEBUG = 0; 
string rstring(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
T rtype(T)(){ return rstring.to!T; } alias rint = rtype!int, rlong = rtype!long, rreal = rtype!real;
T[] rtypes(T)(int n){ return n.iota.map!(i => rtype!T()).array; } alias rint = rtypes!int, rlong = rtypes!long, rreal = rtypes!real;
T[][] rtypess(T)(int n, int m){ return n.iota.map!(i => rtypes!T(m)).array; } alias rint = rtypess!int, rlong = rtypess!long, rreal = rtypess!real;
T chmin(T)(ref T x, T y){ if(x > y) x = y; return x; } T chmax(T)(ref T x, T y){ if(x < y) x = y; return x; }

// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- //

void solve(){
	long r1 = rlong, c1 = rlong, r2 = rlong, c2 = rlong;

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

	ans.writeln;
}

/*
OEIS A014430
x(r, c) = pascal(r + 1, c + 1) - 1
*/

Finite f(long r, long c){
	return pascal(r + 1, c + 1) - 1;
}

struct Finite{
	long value; static long mod = 1_000_000_007;
	this(long v){ value = val(v); }
	static long val(long v){ return (v + mod  - (v / mod) * mod) % mod; }
	bool opCast(T: bool)(){ return value != 0; }
	bool opEquals(Finite b){ return(value == b.value); }
	string toString(){ return value.to!string; }

	Finite opUnary(string s){ long v;
		if(s == "+") v = value;
		else if(s == "-") v = mod - value;
		else if(s == "++") v = value + 1;
		else if(s == "--") v = value + mod - 1;
		else assert(0, "Operator unary " ~ s ~ " not implemented");
		return Finite(v);
	}

	Finite opBinary(string s)(Finite b){ return opBinary!s(b.value); }
	Finite opBinary(string s)(long u){ long v;
		if(s == "+") v = value + u;
		else if(s == "-") v = value + mod - u;
		else if(s == "*") v = value * u;
		else if(s == "/") v = value * inv(u);
		else assert(0, "Operator " ~ s ~ " not implemented");
		return Finite(v);
	}
	Finite opBinaryRight(string s)(long u){ long v;
		if(s == "+") v = u + value;
		else if(s == "-") v = u + mod - value;
		else if(s == "*") v = u * value;
		else if(s == "/") v = u * invvalue;
		else assert(0, "Operator " ~ s ~ " not implemented");
		return Finite(v);
	}
	Finite opAssign(long v){ value = v; return this; }

	Finite opOpAssign(string s)(Finite b){ return opOpAssign!s(b.value); }
	Finite opOpAssign(string s)(long v){
		if(s == "+") value = (value + v) % mod;
		else if(s == "-") value = (value + mod - v) % mod;
		else if(s == "*") value = (value * v) % mod;
		else if(s == "/") value = (value * inv(v)) % mod;
		else assert(0, "Operator " ~ s ~ "= not implemented");
		return this;
	}
	
	private static long[] _inv = [0, 1];
	long invvalue(){ return inv(value); }
	long inv(long v){ int i = val(v).to!int;
		while(i >= _inv.length){
			_inv ~= _inv[(mod % $).to!int] * (mod - mod / _inv.length) % mod;
		}
		return _inv[i];
	}
	
}

// ---以下はユーティリティ--- //

/// mod p における階乗
/// 例 perm(6) = Finite(120)
/// オーダーはプログラム全体で出てくる最大の引数Nに対してO(N)
Finite perm(long x){ int i = Finite.val(x).to!int;
	static Finite[] _perm = [];
	if(_perm.length == 0) _perm ~= Finite(1);
	while(i >= _perm.length) _perm ~= _perm[$ - 1] * _perm.length;
	return _perm[i];
}

/// mod p における階乗の逆元
/// 例 invperm(6) = Finite(1) / Finite(120)
/// オーダーはプログラム全体で出てくる最大の引数Nに対してO(N)
/// ※ invperm(x) と inv(perm(x)) は同じ値だが、後者は計算量が O(mod) になる
Finite invperm(long x){ int i = Finite.val(x).to!int;
	static Finite[] _iperm = [];
	if(_iperm.length == 0) _iperm ~= Finite(1);
	while(i >= _iperm.length) _iperm ~= _iperm[$ - 1] / _iperm.length;
	return _iperm[i];
}

/// mod p における二項係数（定義に注意：(a + b)! / a! / b! ）
/// 例 pascal(3, 2) = Finite(10)
/// ただし、「a < 0 または b < 0」のとき答えは 0 を返します。
Finite pascal(long a, long b){
	if(a < 0 || b < 0) return Finite(0);
	return perm(a + b) * invperm(a) * invperm(b);
}



Measured memory_bytes: 53628