# New Year and Cake

Limak is a little polar bear. According to some old traditions, his bear family prepared a New Year cake. And Limak likes cakes.

As you may know, a New Year cake is a strictly convex polygon with n vertices.

Parents won’t allow Limak to eat more than half of a cake because he would get sick. After some thinking they decided to cut a cake along one of n·(n - 3) / 2 diagonals. Then Limak will get a non-greater piece.

Limak understands rules but he won’t be happy if the second piece happens to be much bigger. Limak’s disappointment will be equal to the difference between pieces’ areas, multiplied by two. It can be proved that it will be integer for the given constraints.

There are n·(n - 3) / 2 possible scenarios. Consider them all and find the sum of values of Limak’s disappointment, modulo 109 + 7.

Input

The first line of the input contains a single integer n (4 ≤ n ≤ 500 000) — the number of vertices in the polygon denoting the cake.

Each of the next n lines contains two integers x i and y i (|x i|, |y i| ≤ 109) — coordinates of the i-th point.

It’s guaranteed that all points are distinct, polygon is strictly convex and points are given in the clockwise order.

Output

Print the sum of values of Limak’s disappointment over all possible scenarios modulo 109 + 7.

Examples

input

52 42 75 75 43 -2

output

90

input

4-1000000000 -50000000 12345671 1-5 -100000000

output

525185196

input

8-10 0-6 60 106 610 06 -60 -10-6 -6

output

5216

Note

In the first sample possible values of Limak’s disappointment are 0, 18, 18, 24, 30.

#include <bits/stdc++.h>

using namespace std;

const int md = 1000000007;

inline void add(int &a, int b) {
a += b;
if (a >= md) a -= md;
}

inline void sub(int &a, int b) {
}

inline int mul(int a, int b) {
return (long long) (a % md) * (b % md) % md;
}

const int N = 1234567;

int x[N], y[N];
int prefmod[N], xmod[N], ymod[N];
int weighted[N], sumx[N], sumy[N];

int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d %d", x + i, y + i);
}
for (int i = 0; i <= n; i++) {
x[i + n] = x[i];
y[i + n] = y[i];
}
for (int i = 0; i < n + n; i++) {
addd[i] = y[i] * 1LL * x[i + 1] - x[i] * 1LL * y[i + 1];
}
pref[0] = 0;
prefmod[0] = 0;
for (int i = 0; i < n + n; i++) {
pref[i + 1] = pref[i] + addd[i];
prefmod[i + 1] = prefmod[i];
}
for (int i = 0; i <= n + n; i++) {
xmod[i] = (x[i] % md + md) % md;
ymod[i] = (y[i] % md + md) % md;
}
weighted[0] = 0;
for (int i = 0; i < n + n; i++) {
weighted[i + 1] = weighted[i];
add(weighted[i + 1], prefmod[i + 1]);
}
sumx[0] = 0; sumy[0] = 0;
for (int i = 0; i < n + n; i++) {
sumx[i + 1] = sumx[i];
sumy[i + 1] = sumy[i];
}
long long total = pref[n];
long long half = total / 2;
int ans = 0;
for (int i = 0; i < n; i++) {
int low = i + 1, high = i + n - 1;
while (low < high) {
int mid = (low + high + 1) >> 1;
long long z = pref[mid] - pref[i];
z += y[mid] * 1LL * x[i] - x[mid] * 1LL * y[i];
if (z <= half) {
low = mid;
} else {
high = mid - 1;
}
}
{
int mid = low;
long long z = pref[mid] - pref[i];
z += y[mid] * 1LL * x[i] - x[mid] * 1LL * y[i];
if (z == half && 2 * half == total) {
int j = mid % n;
if (i > j) {
low--;
}
}
}
int k = low - i;
sub(ans, weighted[i]);
sub(ans, mul(prefmod[i], k));
int sy = sumy[i + k + 1];
sub(sy, sumy[i + 1]);