#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define MP make_pair
#define PB push_back
#define ll long long
#define pii pair<int, int>
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define MS(a, v) memset(a, v, sizeof a)
#define REP(i, n) for(int i = 0; i < n; ++ i)
#define FOR(i, a, b) for(int i = (a); i <= (b); ++ i)
#define FOD(i, a, b) for(int i = (a); i >= (b); -- i)
#define TSun(TZ) freopen(TZ".inp", "r", stdin), freopen(TZ".ans", "w", stdout)
template<class X, class Y>
bool maximize(X & x, const Y & y){
if(x < y){
x = y;
return true;
}
else return false;
}
template<class X, class Y>
bool minimize(X & x, const Y & y){
if(x > y){
x = y;
return true;
}
else return false;
}
const int MAXN = 200005;
const int MOD = 1e9 + 7;
const ll INF = 1e18;
int sum(int a, int b){
return a + b >= MOD ? a + b - MOD : a + b;
}
void add(ll &a, int b){
a += b;
if(a >= MOD) a -= MOD;
}
int Pow(int a, int b){
int res = 1;
while(b > 0){
if(b & 1){
res = 1ll * res * a % MOD;
}
b >>= 1; a = 1ll * a * a % MOD;
}
return res;
}
int n, a[MAXN], b[MAXN], C[4004][4004];
namespace sub1{
bool check(void){
return n <= 2000;
}
void solve(void){
ll res = 0;
FOR(i, 1, n){
FOR(j, i + 1, n){
int x = a[i] + a[j];
int y = b[i] + b[j];
add(res, C[x + y][x]);
}
}
cout << res;
}
}
namespace sub2{
bool check(void){
return *max_element(a + 1, a + n + 1) <= 100 && *max_element(b + 1, b + n + 1) <= 100;
}
int dd[101][101];
void solve(void){
ll res = 0;
FOR(i, 1, n)
++ dd[ a[i] ][ b[i] ];
int u2 = Pow(2, MOD - 2);
FOR(i, 1, 100) FOR(j, 1, 100) if(dd[i][j]){
FOR(u, 1, 100) FOR(v, 1, 100) if(dd[u][v]){
ll c1 = dd[i][j], c2 = dd[u][v];
int x = i + u, y = j + v;
ll val = C[x + y][y];
if(u == i && v == j)
add(res, val * ((c1 * (c1 - 1) / 2) % MOD) % MOD);
else
add(res, val * c1 % MOD * c2 % MOD);
}
}
cout << res * u2 % MOD;
}
}
void solve(void){
cin >> n;
FOR(i, 1, n) cin >> a[i] >> b[i];
FOR(i, 0, 2000) C[i][0] = 1;
FOR(i, 1, 2000)
FOR(j, 1, i)
C[i][j] = sum(C[i - 1][j], C[i - 1][j - 1]);
// if(sub1 :: check())
// return sub1 :: solve();
if(sub2 :: check())
return sub2 :: solve();
}
int main(void){
ios_base :: sync_with_stdio(0);
cin.tie(0); cout.tie(0);
#define TaZinh "test"
if(fopen(TaZinh".inp", "r"))
TSun(TaZinh);
int Sun = 1;
// cin >> Sun;
REP(love, Sun) solve();
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCiNkZWZpbmUgZmkgZmlyc3QKI2RlZmluZSBzZSBzZWNvbmQKI2RlZmluZSBNUCBtYWtlX3BhaXIKI2RlZmluZSBQQiBwdXNoX2JhY2sKI2RlZmluZSBsbCBsb25nIGxvbmcKI2RlZmluZSBwaWkgcGFpcjxpbnQsIGludD4KI2RlZmluZSBTWihhKSBpbnQoYS5zaXplKCkpCiNkZWZpbmUgQUxMKGEpIGEuYmVnaW4oKSwgYS5lbmQoKQojZGVmaW5lIE1TKGEsIHYpIG1lbXNldChhLCB2LCBzaXplb2YgYSkKI2RlZmluZSBSRVAoaSwgbikgZm9yKGludCBpID0gMDsgaSA8IG47ICsrIGkpCiNkZWZpbmUgRk9SKGksIGEsIGIpIGZvcihpbnQgaSA9IChhKTsgaSA8PSAoYik7ICsrIGkpCiNkZWZpbmUgRk9EKGksIGEsIGIpIGZvcihpbnQgaSA9IChhKTsgaSA+PSAoYik7IC0tIGkpCiNkZWZpbmUgVFN1bihUWikgZnJlb3BlbihUWiIuaW5wIiwgInIiLCBzdGRpbiksIGZyZW9wZW4oVFoiLmFucyIsICJ3Iiwgc3Rkb3V0KQoKdGVtcGxhdGU8Y2xhc3MgWCwgY2xhc3MgWT4KICAgICAgICBib29sIG1heGltaXplKFggJiB4LCBjb25zdCBZICYgeSl7CiAgICAgICAgICAgICAgICBpZih4IDwgeSl7CiAgICAgICAgICAgICAgICAgICAgICAgIHggPSB5OwogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVsc2UgcmV0dXJuIGZhbHNlOwogICAgICAgIH0KCnRlbXBsYXRlPGNsYXNzIFgsIGNsYXNzIFk+CiAgICAgICAgYm9vbCBtaW5pbWl6ZShYICYgeCwgY29uc3QgWSAmIHkpewogICAgICAgICAgICAgICAgaWYoeCA+IHkpewogICAgICAgICAgICAgICAgICAgICAgICB4ID0geTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBlbHNlIHJldHVybiBmYWxzZTsKICAgICAgICB9Cgpjb25zdCBpbnQgTUFYTiA9IDIwMDAwNTsKY29uc3QgaW50IE1PRCA9IDFlOSArIDc7CmNvbnN0IGxsIElORiA9IDFlMTg7CgppbnQgc3VtKGludCBhLCBpbnQgYil7CiAgICAgICAgcmV0dXJuIGEgKyBiID49IE1PRCA/IGEgKyBiIC0gTU9EIDogYSArIGI7Cn0KCnZvaWQgYWRkKGxsICZhLCBpbnQgYil7CiAgICAgICAgYSArPSBiOwogICAgICAgIGlmKGEgPj0gTU9EKSBhIC09IE1PRDsKfQoKaW50IFBvdyhpbnQgYSwgaW50IGIpewogICAgICAgIGludCByZXMgPSAxOwogICAgICAgIHdoaWxlKGIgPiAwKXsKICAgICAgICAgICAgICAgIGlmKGIgJiAxKXsKICAgICAgICAgICAgICAgICAgICAgICAgcmVzID0gMWxsICogcmVzICogYSAlIE1PRDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGIgPj49IDE7IGEgPSAxbGwgKiBhICogYSAlIE1PRDsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHJlczsKfQoKaW50IG4sIGFbTUFYTl0sIGJbTUFYTl0sIENbNDAwNF1bNDAwNF07CgpuYW1lc3BhY2Ugc3ViMXsKICAgICAgICBib29sIGNoZWNrKHZvaWQpewogICAgICAgICAgICAgICAgcmV0dXJuIG4gPD0gMjAwMDsKICAgICAgICB9CgogICAgICAgIHZvaWQgc29sdmUodm9pZCl7CiAgICAgICAgICAgICAgICBsbCByZXMgPSAwOwogICAgICAgICAgICAgICAgRk9SKGksIDEsIG4pewogICAgICAgICAgICAgICAgICAgICAgICBGT1IoaiwgaSArIDEsIG4pewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4ID0gYVtpXSArIGFbal07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHkgPSBiW2ldICsgYltqXTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGQocmVzLCBDW3ggKyB5XVt4XSk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGNvdXQgPDwgcmVzOwogICAgICAgIH0KfQoKbmFtZXNwYWNlIHN1YjJ7CiAgICAgICAgYm9vbCBjaGVjayh2b2lkKXsKICAgICAgICAgICAgICAgIHJldHVybiAqbWF4X2VsZW1lbnQoYSArIDEsIGEgKyBuICsgMSkgPD0gMTAwICYmICptYXhfZWxlbWVudChiICsgMSwgYiArIG4gKyAxKSA8PSAxMDA7CiAgICAgICAgfQoKICAgICAgICBpbnQgZGRbMTAxXVsxMDFdOwoKICAgICAgICB2b2lkIHNvbHZlKHZvaWQpewogICAgICAgICAgICAgICAgbGwgcmVzID0gMDsKICAgICAgICAgICAgICAgIEZPUihpLCAxLCBuKQogICAgICAgICAgICAgICAgICAgICAgICArKyBkZFsgYVtpXSBdWyBiW2ldIF07CgogICAgICAgICAgICAgICAgaW50IHUyID0gUG93KDIsIE1PRCAtIDIpOwoKICAgICAgICAgICAgICAgIEZPUihpLCAxLCAxMDApIEZPUihqLCAxLCAxMDApIGlmKGRkW2ldW2pdKXsKICAgICAgICAgICAgICAgICAgICAgICAgRk9SKHUsIDEsIDEwMCkgRk9SKHYsIDEsIDEwMCkgaWYoZGRbdV1bdl0pewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxsIGMxID0gZGRbaV1bal0sIGMyID0gZGRbdV1bdl07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHggPSBpICsgdSwgeSA9IGogKyB2OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxsIHZhbCA9IENbeCArIHldW3ldOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHUgPT0gaSAmJiB2ID09IGopCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGQocmVzLCB2YWwgKiAoKGMxICogKGMxIC0gMSkgLyAyKSAlIE1PRCkgJSBNT0QpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZChyZXMsIHZhbCAqIGMxICUgTU9EICogYzIgJSBNT0QpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBjb3V0IDw8IHJlcyAqIHUyICUgTU9EOwogICAgICAgIH0KfQoKCnZvaWQgc29sdmUodm9pZCl7CiAgICAgICAgY2luID4+IG47CiAgICAgICAgRk9SKGksIDEsIG4pIGNpbiA+PiBhW2ldID4+IGJbaV07CgogICAgICAgIEZPUihpLCAwLCAyMDAwKSBDW2ldWzBdID0gMTsKICAgICAgICBGT1IoaSwgMSwgMjAwMCkKICAgICAgICAgICAgICAgIEZPUihqLCAxLCBpKQogICAgICAgICAgICAgICAgICAgICAgICBDW2ldW2pdID0gc3VtKENbaSAtIDFdW2pdLCBDW2kgLSAxXVtqIC0gMV0pOwoKLy8gICAgICAgIGlmKHN1YjEgOjogY2hlY2soKSkKLy8gICAgICAgICAgICAgICAgcmV0dXJuIHN1YjEgOjogc29sdmUoKTsKICAgICAgICBpZihzdWIyIDo6IGNoZWNrKCkpCiAgICAgICAgICAgICAgICByZXR1cm4gc3ViMiA6OiBzb2x2ZSgpOwp9CgppbnQgbWFpbih2b2lkKXsKCiAgICAgICAgaW9zX2Jhc2UgOjogc3luY193aXRoX3N0ZGlvKDApOwogICAgICAgIGNpbi50aWUoMCk7IGNvdXQudGllKDApOwoKICAgICAgICAjZGVmaW5lIFRhWmluaCAidGVzdCIKCiAgICAgICAgaWYoZm9wZW4oVGFaaW5oIi5pbnAiLCAiciIpKQogICAgICAgICAgICAgICAgVFN1bihUYVppbmgpOwoKICAgICAgICBpbnQgU3VuID0gMTsKLy8gICAgICAgIGNpbiA+PiBTdW47CiAgICAgICAgUkVQKGxvdmUsIFN1bikgc29sdmUoKTsKCiAgICAgICAgcmV0dXJuIDA7Cn0K