// 21:50 - 22:02 #include using namespace std; #define fi first #define se second #define all(x) x.begin(), x.end() #define lch (o << 1) #define rch (o << 1 | 1) typedef double db; typedef long long ll; typedef unsigned int ui; typedef pair pint; typedef tuple tint; const int N = 2000 + 5; const int MOD = 1e9 + 7; const int INV3 = 333333336; const int INF = 0x3f3f3f3f; const ll INF_LL = 0x3f3f3f3f3f3f3f3f; struct Point { ll x, y; Point operator+(Point rhs) { return (Point){(x + rhs.x) % MOD, (y + rhs.y) % MOD}; } Point operator-(Point rhs) { return (Point){(x - rhs.x) % MOD, (y - rhs.y) % MOD}; } ll operator*(Point rhs) { return (x * rhs.y - y * rhs.x) % MOD; } bool operator==(Point rhs) { return x == rhs.x && y == rhs.y; } }; Point p[N]; int n; ll Solve(int rt) { vector> _pts; for (int i = 1; i <= n; i++) if (i != rt) { auto tmp = p[i] - p[rt]; if (tmp.x != 0 || tmp.y != 0) _pts.push_back(make_pair(atan2(tmp.y, tmp.x), tmp)); } sort(all(_pts), [](pair &a, pair &b) { return a.fi < b.fi; }); int m = _pts.size(); vector pts; for (int i = 0; i < m; i++) pts.push_back(_pts[i].se); for (int i = 0; i < m; i++) pts.push_back(_pts[i].se); Point sum = (Point){0, 0}; ll ret = 0, pre = 0; int r = 0; for (int i = 0; i < m; i++) { if (i == 0 || !(pts[i] == pts[i - 1])) { while (r < i + m && pts[i] * pts[r] >= 0) { sum = sum + pts[r]; r++; } pre = pts[i] * sum; } ret = (ret + pre) % MOD; sum = sum - pts[i]; } return ret; } int main() { ios::sync_with_stdio(0); cin >> n; for (int i = 1; i <= n; i++) cin >> p[i].x >> p[i].y; ll ans = 0; for (int i = 1; i <= n; i++) { ll tmp = Solve(i); ans = (ans + tmp) % MOD; } ans = ans * INV3 % MOD; cout << (ans % MOD + MOD) % MOD << endl; return 0; }