#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

template<unsigned P> struct ModInt {
  using M = ModInt;
  unsigned v;
  constexpr ModInt() : v(0) {}
  constexpr ModInt(auto x) : v(x >= 0 ? x % P : (P - -x % P) % P) {}
  constexpr ModInt(unsigned v, int) : v(v) {}
  static constexpr unsigned p() { return P; }
  M operator+() const { return *this; }
  M operator-() const { return {v ? P - v : 0, 0}; }
  explicit operator bool() const noexcept { return v; }
  bool operator!() const noexcept { return !(bool)*this; }
  M operator*(M r) const { return M(*this) *= r; }
  M operator/(M r) const { return M(*this) /= r; }
  M operator+(M r) const { return M(*this) += r; }
  M operator-(M r) const { return M(*this) -= r; }
  bool operator==(M r) const { return v == r.v; }
  bool operator!=(M r) const { return !(*this == r); }
  M& operator*=(M r) { v = (uint64_t)v * r.v % P; return *this; }
  M& operator/=(M r) { return *this *= r.inv(); }
  M& operator+=(M r) { if ((v += r.v) >= P) v -= P; return *this; }
  M& operator-=(M r) { if ((v += P - r.v) >= P) v -= P; return *this; }
  M inv() const {
    int a = v, b = P, x = 1, u = 0;
    while (b) {
      int q = a / b;
      swap(a -= q * b, b);
      swap(x -= q * u, u);
    }
    assert(a == 1);
    return x;
  }
  M pow(auto n) const {
    if (n < 0) return pow(-n).inv();
    M res = 1;
    for (M a = *this; n; a *= a, n >>= 1) if (n & 1) res *= a;
    return res;
  }
  friend M operator*(auto l, M r) { return M(l) *= r; }
  friend M operator/(auto l, M r) { return M(l) /= r; }
  friend M operator+(auto l, M r) { return M(l) += r; }
  friend M operator-(auto l, M r) { return M(l) -= r; }
  friend ostream& operator<<(ostream& os, M r) { return os << r.v; }
  friend istream& operator>>(istream& is, M& r) { lint x; is >> x; r = x; return is; }
  friend bool operator==(auto l, M r) { return M(l) == r; }
  friend bool operator!=(auto l, M r) { return !(l == r); }
};
using Mint = ModInt<(unsigned)1e9 + 7>;
V<Mint> fact, ifact;
void init(int n) {
  fact.resize(n + 1);
  fact[0] = 1;
  for (int i = 1; i <= n; ++i) {
    fact[i] = i * fact[i - 1];
  }
  ifact.resize(n + 1);
  ifact[n] = 1 / fact[n];
  for (int i = n; i > 0; --i) {
    ifact[i - 1] = i * ifact[i];
  }
}
Mint comb(int n, int r) {
  if (r < 0 or r > n) return 0;
  return fact[n] * ifact[r] * ifact[n - r];
}

constexpr double pi = acos(-1);
struct C {
  float x, y;
  C() : x(0), y(0) {}
  C(double x, double y) : x(x), y(y) {}
  C(double th) : x(cos(th)), y(sin(th)) {}
  C operator~() const { return {x, -y}; }
  C operator*(const C& r) const { return {x * r.x - y * r.y, x * r.y + y * r.x}; }
  C operator+(const C& r) const { return {x + r.x, y + r.y}; }
  C operator-(const C& r) const { return {x - r.x, y - r.y}; }
};

constexpr int N = 1 << 12;
void fft(array<C, N>& a, bool inv = false) {
  int j = 0;
  for (int i = 1; i < N; ++i) {
    int w = N >> 1;
    while (j >= w) j -= w, w >>= 1;
    j += w;
    if (i < j) swap(a[i], a[j]);
  }
  static VV<C> xi;
  for (int k = 0; 1 << k < N; ++k) if (k >= (int)xi.size()) {
    xi.emplace_back(1 << k);
    for (int i = 0; i < 1 << k; ++i) {
      xi[k][i] = C(i * pi / (1 << k));
    }
  }
  for (int k = 0; 1 << k < N; ++k) {
    const int w = 1 << k;
    for (int s = 0; s < N; s += 2 * w) {
      for (int i = s; i < s + w; ++i) {
        C p = a[i], q = a[i + w] * (inv ? ~xi[k][i - s] : xi[k][i - s]);
        a[i] = p + q, a[i + w] = p - q;
      }
    }
  }
}
void fftR2(array<C, N>& a, array<C, N>& b) {
  array<C, N> c;
  for (int i = 0; i < N; ++i) {
    c[i] = {a[i].x, b[i].x};
  }
  fft(c);
  for (int i = 0; i < N; ++i) {
    a[i] = (c[i] + ~c[-i & N - 1]) * C(0.5, 0);
    b[i] = (c[i] - ~c[-i & N - 1]) * C(0, -0.5);
  }
}
void ifftR2(array<C, N>& a, array<C, N>& b) {
  array<C, N> c;
  for (int i = 0; i < N; ++i) {
    c[i] = a[i] + C(0, 1) * b[i];
  }
  fft(c, true);
  for (int i = 0; i < N; ++i) {
    a[i].x = c[i].x;
    b[i].x = c[i].y;
  }
}

int main() {
  init(8000);
  static array< array<C, N>, N > c;
  auto fft2D = [&](bool inv = false) -> void {
    for (int i = 0; i < N; i += 2) {
      if (inv) {
        fft(c[i], true);
        fft(c[i + 1], true);
      } else {
        fftR2(c[i], c[i + 1]);
      }
    }
    for (int j = 0; j < N; ++j) for (int i = 0; i < j; ++i) {
      swap(c[i][j], c[j][i]);
    }
    for (int i = 0; i < N; i += 2) {
      if (inv) {
        ifftR2(c[i], c[i + 1]);
      } else {
        fft(c[i]);
        fft(c[i + 1]);
      }
    }
    if (inv) {
      for (auto&& v : c) for (auto&& e : v) {
        e.x /= N * N;
      }
    }
  };

  cin.tie(nullptr); ios::sync_with_stdio(false);
  int n; cin >> n;
  V<> a(n), b(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i] >> b[i];
    c[a[i]][b[i]].x += 1;
  }

  fft2D();
  for (auto&& v : c) for (auto&& e : v) {
    e = e * e;
  }
  fft2D(true);

  map< pair<int, int>, int > mp;
  for (int i = 0; i < n; ++i) {
    ++mp[{a[i], b[i]}];
  }
  if (mp.size() <= 1e4) {
    Mint res;
    for (const auto & e0 : mp) for (const auto& e1 : mp) {
      res += (lint)e0.second * e1.second * comb(
        e0.first.first + e1.first.first + e0.first.second + e1.first.second,
        e0.first.first + e1.first.first
      );
    }
    for (int i = 0; i < n; ++i) {
      res -= comb(2 * (a[i] + b[i]), 2 * a[i]);
    }
    res /= 2;
    return cout << res << '\n', 0;
  }

  Mint res;
  for (int x = 1; x <= 4000; ++x) for (int y = 1; y <= 4000; ++y) {
    lint cnt = c[x][y].x + 0.5;
    res += cnt * comb(x + y, x);
  }
  for (int i = 0; i < n; ++i) {
    res -= comb(2 * (a[i] + b[i]), 2 * a[i]);
  }
  res /= 2;
  cout << res << '\n';
}

Measured memory_bytes: 145536