#include using namespace std; #define int long long #define ii pair #define app push_back #define all(a) a.begin(), a.end() #define bp __builtin_popcountll #define ll long long #define mp make_pair #define f first #define s second #define Time (double)clock()/CLOCKS_PER_SEC #define debug(x) std::cout << #x << ": " << x << '\n'; const int MOD = 1000 * 1000 * 1000 + 7; int mod(int n) { n %= MOD; if (n < 0) return n + MOD; else return n; } int fp(int a, int p) { int ans = 1, c = a; for (int i = 0; (1ll << i) <= p; ++i) { if ((p >> i) & 1) ans = mod(ans * c); c = mod(c * c); } return ans; } int dv(int a, int b) { return mod(a * fp(b, MOD - 2)); } struct Point { int x, y; Point operator - (Point p) { return {x - p.x, y - p.y}; } Point operator + (Point p) { return {x + p.x, y + p.y}; }; int operator * (Point p) { return x * p.y - y * p.x; } int operator % (Point p) { return x * p.x + y * p.y; } bool operator == (Point p) { return x == p.x && y == p.y; } }; bool col(Point a, Point b) { return a % b > 0 && a * b == 0; } Point v[4007]; signed main() { #ifdef HOME freopen("input.txt", "r", stdin); #else #define endl '\n' ios_base::sync_with_stdio(0); cin.tie(0); #endif int n; cin >> n; vector a(n); for (int i = 0; i < n; ++i) { cin >> a[i].x >> a[i].y; } int ans = 0; for (int s = 0; s < n; ++s) { int sz = 0; for (int i = 0; i < n; ++i) if (!(a[s] == a[i])) v[sz++] = a[i] - a[s]; auto comp = [] (Point a, Point b) { return atan2(a.y, a.x) < atan2(b.y, b.x); }; sort(v, v + sz, comp); for (int i = sz; i < 2 * sz; ++i) v[i] = v[i - sz]; int j = -1; Point sum = {0, 0}; for (int i = 0; i < sz; ++i) { if (i > j) { assert(i == j + 1); j = i; sum = v[i]; } else { sum = sum - v[i-1]; } while (j + 1 < i + sz && col(v[i], v[j]) && col(v[i], v[j+1])) { ++j; sum = sum + v[j]; } while (j + 1 < i + sz && v[i] * v[j+1] > 0) { ++j; sum = sum + v[j]; } ans += v[i] * sum; ans %= MOD; } } cout << dv(ans, 3) << endl; }