Fence

Sum x! times y! over all unit cells inside an axis-aligned polygon, modulo 1e9+7, with coordinates up to 1e9.

Hard8MathPrefix sumGeometryNumber theoryNo attempts yetTime limit3sMemory limit512 MB

Problem

A pasture where factorials grow lies in the standard coordinate system, where the xx coordinate increases to the right and the yy coordinate increases upward. A cell is a square with side length 1 and sides parallel to the coordinate axes, such that both coordinates of its lower left corner A=(xA,yA)A = (x_A, y_A) are nonnegative integers. The value of such a cell is xA!×yA!x_A! \times y_A!, where a!=1×2××aa! = 1 \times 2 \times \cdots \times a for a1a \ge 1 and 0!=10! = 1.

A fence is a polygon whose sides are parallel to the coordinate axes. Given a fence, compute the sum of the values of all cells inside the fence, modulo 109+710^9 + 7.

Input

The first line contains a positive integer nn (n100n \le 100), the number of vertices of the fence.

The kk-th of the next nn lines contains integers xkx_k and yky_k (0xk,yk1090 \le x_k, y_k \le 10^9), the coordinates of the kk-th vertex of the fence. The vertices are listed in order along the polygon.

You may assume that the vertices form a polygon whose sides are parallel to the coordinate axes. In particular, the polygon does not intersect itself, and two adjacent sides are never parallel.

Output

Print the requested sum modulo 109+710^9 + 7 on the first line.

Hint

The figure shows the fence from the third example and the value of each cell. The values of the cells inside the fence add up to 119.