/**
 *    author  : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏
 *    created : 2020-04-08 14:16:42
 **/

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#include <cmath>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

using int64 = long long;

template <class T>
using binary_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
  os << '{';
  size_t n = vec.size();
  for (size_t i = 0; i < n; ++i) {
    os << vec[i];
    if (i != n - 1) os << ',';
  }
  os << '}';
  return os;
}
template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) {
  return os << '{' << p.first << " " << p.second << '}';
}
template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) {
  os << '{';
  for (auto it = mp.begin(); it != mp.end(); ++it) {
    os << '{' << it->first << ':' << it->second << '}';
    if (it != --mp.end()) os << ',';
  }
  os << '}';
  return os;
}
template <class T>
std::ostream& operator<<(std::ostream& os, const std::set<T>& st) {
  os << '{';
  for (auto it = st.begin(); it != st.end(); ++it) {
    os << *it;
    if (it != --st.end()) os << ',';
  }
  os << '}';
  return os;
}
template <class T>
std::istream& operator>>(std::istream& is, std::vector<T>& vec) {
  size_t n = vec.size();
  for (size_t i = 0; i < n; ++i) is >> vec[i];
  return is;
}

#define all(_) begin(_), end(_)
#define rall(_) rbegin(_), rend(_)

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

void debug_out() { std::cerr << '\n'; }

template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}

class Combination {
 public:
  static constexpr int mod_ = 1000000007;
  static constexpr int n_ = 2000000 + 5;

  Combination() { build(); }

  std::array<int64, n_> fact_;
  std::array<int64, n_> inv_;
  std::array<int64, n_> finv_;

  // return nCk
  int64 get(int n, int k) const noexcept {
    if (n < k || n < 0 || k < 0) return 0;
    return fact_[n] * (finv_[k] * finv_[n - k] % mod_) % mod_;
  }

 private:
  void build() noexcept {
    fact_[0] = 1;
    fact_[1] = 1;
    finv_[0] = 1;
    finv_[1] = 1;
    inv_[1] = 1;
    for (int i = 2; i < n_; ++i) {
      fact_[i] = fact_[i - 1] * i % mod_;
      inv_[i] = mod_ - inv_[mod_ % i] * (mod_ / i) % mod_;
      finv_[i] = finv_[i - 1] * inv_[i] % mod_;
    }
  }
};

void ABC_154_F() {
  int64 r1, c1, r2, c2;
  cin >> r1 >> c1 >> r2 >> c2;

  int64 ans = 0;

  Combination kyomu;

  for (int64 i = r1; i <= r2; ++i) {
    ans += (((c2 + 1LL) * kyomu.get(c2 + i + 1LL, i) % kyomu.mod_) *
            kyomu.inv_[i + 1]) %
               kyomu.mod_ -
           ((c1 * kyomu.get(c1 + i, i) % kyomu.mod_) * kyomu.inv_[i + 1] %
            kyomu.mod_);
    while (ans < 0) ans += kyomu.mod_;
    ans %= kyomu.mod_;
  }

  cout << ans << endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  ABC_154_F();

  return 0;
}

Measured memory_bytes: 47104