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

const int64_t mod = 1000000007;
vector<int64_t> fact, inv;

int64_t power(int64_t n, int64_t k) {
  if (k == 0) return 1;
  int64_t ans = power(n * n % mod, k / 2);
  if (k % 2) ans = ans * n % mod;
  return ans;
}

void init(int n) {
  fact.push_back(1);
  inv.push_back(1);
  for (int i = 1; i <= n; i++) {
    fact.push_back(fact.at(i - 1) * i % mod);
    inv.push_back(power(fact.at(i), mod - 2));
  }
}

int64_t ncr(int64_t n, int64_t r) {
  return fact.at(n) * inv.at(r) % mod * inv.at(n - r) % mod;
}

int main() {
  int64_t r1, c1, r2, c2;
  cin >> r1 >> c1 >> r2 >> c2;
  r2++; c2++;
  init(r2 + c2);
  cout << (ncr(r2 + c2, r2) + ncr(r1 + c1, r1) - ncr(r2 + c1, r2) - ncr(r1 + c2, r1) + 2 * mod) % mod << endl;
}
