Snuke is standing on a two-dimensional plane. In one operation, he can move by 1 in the positive x-direction, or move by 1 in the positive y-direction.

Let us define a function f(r, c) as follows:

* f(r,c) :=  (The number of paths from the point (0, 0) to the point (r, c) that Snuke can trace by repeating the operation above)



Given are integers r_1, r_2, c_1, and c_2. Find the sum of f(i, j) over all pair of integers (i, j) such that r_1 ≤ i ≤ r_2 and c_1 ≤ j ≤ c_2, and compute this value modulo (10^9+7).

Constraints

* 1 ≤ r_1 ≤ r_2 ≤ 10^6
* 1 ≤ c_1 ≤ c_2 ≤ 10^6
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


r_1 c_1 r_2 c_2


Output

Print the sum of f(i, j) modulo (10^9+7).

Examples

Input

1 1 2 2


Output

14


Input

314 159 2653 589


Output

602215194

import java.math.BigInteger;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int r1 = scanner.nextInt();
        int c1 = scanner.nextInt();
        int r2 = scanner.nextInt();
        int c2 = scanner.nextInt();
        System.out.println(manyManyPaths(r1, c1, r2, c2));
    }

    public static int manyManyPaths(final int r1, final int c1, final int r2, final int c2){
        final int m = 1_000_000_007;
        final BigInteger bigM = BigInteger.valueOf(m);
        HashSet<Integer> neededFactors = new HashSet<>();
        HashSet<Integer> neededReversedFactors = new HashSet<>();
        HashMap<Integer, BigInteger> calculatedFactors = new HashMap<>();
        HashMap<Integer, BigInteger> calculatedReversedFactors = new HashMap<>();
        neededFactors.add(c1+r1);
        neededFactors.add(c1+r2+1);
        neededFactors.add(c2+r1+1);
        neededFactors.add(c2+r2+2);
        neededReversedFactors.add(c1);
        neededReversedFactors.add(r1);
        neededReversedFactors.add(r2+1);
        neededReversedFactors.add(c2+1);
        calculatedFactors.put(0, BigInteger.ONE);
        calculatedFactors.put(1, BigInteger.ONE);
        calculatedReversedFactors.put(0, BigInteger.ONE);
        calculatedReversedFactors.put(1, BigInteger.ONE);

        long tmp = 1;
        for (int i = 2; i <= c2+r2+2; i++) {
            tmp = tmp*i%m;
            if(neededFactors.contains(i)){
                calculatedFactors.put(i, BigInteger.valueOf(tmp));
            }
            if(neededReversedFactors.contains(i)){
                calculatedReversedFactors.put(i, BigInteger.valueOf(tmp).modInverse(bigM));
            }
        }
        return calculatedFactors.get(c1+r1).multiply(calculatedReversedFactors.get(c1)).multiply(calculatedReversedFactors.get(r1))
                .subtract(calculatedFactors.get(c1+r2+1).multiply(calculatedReversedFactors.get(c1)).multiply(calculatedReversedFactors.get(r2+1)))
                .subtract(calculatedFactors.get(c2+r1+1).multiply(calculatedReversedFactors.get(c2+1)).multiply(calculatedReversedFactors.get(r1)))
                .add(calculatedFactors.get(c2+r2+2).multiply(calculatedReversedFactors.get(c2+1)).multiply(calculatedReversedFactors.get(r2+1)))
                .mod(bigM).intValue();
    }
}
