import std.algorithm;
import std.array;
import std.conv;
import std.format;
import std.math;
import std.stdio;
import std.string;

long[][] choose(long n, long r)
{
  long[][] dp = new long[][](n+1, r+1);

  long i,j = 0;
  for (i=0;i<n;i++) {
    dp[i][0] = 1;
  }
  for (j=0;j<r;j++) {
    dp[0][j] = 0;
  }
  for (i=1;i<=n;i++) {
    for (j=1;j<=r;j++) {
      if (i==j) {
        dp[i][j] = 1;
      } else if (j>i) {
        dp[i][j] = 0;
      } else {
        dp[i][j] = dp[i-1][j-1] + dp[i-1][j];
      }
    }
  }

  return dp;
}

immutable long MOD = 10^^9+7;
immutable long MAX = 2000;

void main()
{
  string lines;
  string buf;
  while (!stdin.eof) {
    buf = stdin.readln();
    lines ~= buf;
  }
  string[] array = splitLines(lines);

  //    string lines = q"[10
  // 1 4
  // 3 2
  // 9 1
  // 1 7
  // 2 1
  // 1 4
  // 3 2
  // 4 1
  // 1 1
  // 2 1]";
  //    string[] array  = splitLines(lines);

  immutable long N = array[0].to!long;
  array = array[1..$];

  immutable long[] a = array.map!(e => e.split(" ")[0].to!long).array;
  immutable long[] b = array.map!(e => e.split(" ")[1].to!long).array;

  const dp = choose(MAX*2, MAX*2);

  long ans = 0;

  for (int i = 0; i < a.length; i++) {
    long ai = a[i] + b[i];
    for (int j = 0; j < a.length; j++) {
      long n = ai + a[j] + b[j];
      long r = b[i] + b[j];
      ans += dp[n][r];
    }
    ans -= dp[2*ai][2*b[i]];
  }

  writeln( (ans / 2) % MOD );
}
