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

long long a, b, c, d, m = 0;
const long long M = 1e9 + 7;
long long g[2000003], h[2000003];

long long pow(long long p, long long q) {
	long long r = 1, s = p;

	while (q) {
		if (q & 1)
			r = r * s % M;

		s = s * s % M;
		q >>= 1;
	}

	return r;
}

int main()
{
	cin >> a >> b >> c >> d;

	g[1] = 1;
	h[1] = 1;

	for (long long i = 2; i <= c + d + 2; i++) {
		g[i] = g[i - 1] * i % M;
		h[i] = pow(g[i], M - 2);
	}

	m = (g[c + d + 2] * h[c + 1] % M) * h[d + 1] % M;
	m = (m + (g[a + b] * h[a] % M) * h[b] % M) % M;
	m = (m + M - (g[b + c + 1] * h[b] % M) * h[c + 1] % M) % M;
	m = (m + M - (g[a + d + 1] * h[a] % M) * h[d + 1] % M) % M;

	cout << m << endl;
}
