#include <bits/stdc++.h>
using namespace std;
int const maxn = 2e6 + 100;
int const mod = 1e9 + 7;
long long num[maxn];
void init() {
  num[0] = 1;
  for (int i = 1; i < maxn; i++) num[i] = num[i - 1] * i % mod;
}
long long qpow(long long m, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res = res * m % mod;
    n >>= 1;
    m = m * m % mod;
  }
  return res;
}
long long C(long long n, long long m) {
  return num[n] * qpow(num[m], mod - 2) % mod * qpow(num[n - m], mod - 2) % mod;
}
int main() {
  init();
  long long r1, r2, c1, c2;
  scanf("%lld%lld%lld%lld", &r1, &c1, &r2, &c2);
  long long res = C(r2 + c2 + 2, c2 + 1) + C(r1 + c1, c1) - C(r2 + c1 + 1, c1) -
                  C(r1 + c2 + 1, c2 + 1);
  printf("%lld\n", (res + (long long)mod * 4) % mod);
}
