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

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

  int 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;
}

void main()
{
  string line, lines;
  string[] array;

  while ((line = readln()) !is null) {
    lines ~= line;
    lines ~= "\n";
  }
  array = splitLines(lines);

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

  const int N = array[0].to!int;
  array = array[1..$];

  int[] a = array.map!(e => e.split(" ")[0].to!int).array;
  int[] b = array.map!(e => e.split(" ")[1].to!int).array;
  int A = reduce!(max)(a);
  int B = reduce!(max)(b);

  auto dp = choose(A*2+B*2, B*2);

  int ans, except = 0;

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

    except += dp[2*(a[i]+b[i])][2*b[i]];
  }

  writeln( ((ans - except) / 2) % (pow(10, 9) + 7) );
}
