/*
    Author: isaf27 (Ivan Safonov)
*/
 
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
 
using namespace std;
 
//defines
typedef long long ll;
typedef long double ld;
#define TIME clock() * 1.0 / CLOCKS_PER_SEC
#define fastIO ios_base::sync_with_stdio(0)
#define nul point(0, 0)
#define str_to_int(stroka) atoi(stroka.c_str())
#define str_to_ll(stroka) atoll(stroka.c_str())
#define str_to_double(stroka) atof(stroka.c_str())
#define what_is(x) cerr << #x << " is " << x << endl
#define solve_system int number; cin >> number; for (int i = 0; i < number; i++) solve()
#define solve_system_scanf int number; scanf("%d", &number); for (int i = 0; i < number; i++) solve()
 
//permanent constants
const ld pi = 3.141592653589793238462643383279;
const ld log23 = 1.58496250072115618145373894394781;
const ld eps = 1e-8;
const ll INF = 1e18 + 239;
const ll prost = 239;
const int two = 2;
const int th = 3;
const ll MOD = 1e9 + 7;
const ll MOD2 = MOD * MOD;
const int BIG = 1e9 + 239;
const int alf = 26;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int dig = 10;
const string str_alf = "abcdefghijklmnopqrstuvwxyz";
const string str_alf_big = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int digarr[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
const int bt = 31;
const int fr = 4;
 
//easy functions
template< typename T >
inline T gcd(T a, T b) { return a ? gcd(b % a, a) : b; }
template< typename T >
inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }
inline bool is_down(char x) { return ('a' <= x && x <= 'z'); }
inline bool is_upper(char x) { return ('A' <= x && x <= 'Z'); }
inline bool is_digit(char x) { return ('0' <= x && x <= '9'); }
ll power(ll a, int k)
{
    if (k == 0) return 1;
    ll t = power(a, k >> 1);
    t = (t * t) % MOD;
    if (k & 1) t = (t * a) % MOD;
    return t;
}
 
//random
mt19937 rnd(239);
 
//constants
const int M = 2 * 1e5 + 239;
const int N = 2 * 1e3 + 239;
const int L = 20;
const int T = (1 << 20);
const int B = trunc(sqrt(M)) + 1;
const int X = 2010;
const int X2 = 2 * X;
const int MD = 1e9 + 7;
 
int c[X2][X2], n, m, a[M], b[M], d[X][X];
ll f[X][X];
 
int main()
{
    #ifdef ONPC
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fastIO;
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> a[i] >> b[i];
    m = 0;
    for (int i = 0; i < n; i++)
    {
        m = max(m, a[i]);
        m = max(m, b[i]);
    }
    for (int i = 0; i <= 2 * m; i++)
    {
        c[i][0] = 1;
        c[0][i] = 1;
    }
    for (int s = 2; s <= 4 * m; s++)
        for (int i = 1; i < min(2 * m + 1, s); i++)
        {
            int j = s - i;
            if (j <= 0 || j > 2 * m) continue;
            c[i][j] = c[i - 1][j] + c[i][j - 1];
            if (c[i][j] >= MD) c[i][j] -= MD;
        }
    /*for (int i = 0; i <= 2 * m; i++, cerr << "\n")
        for (int j = 0; j <= 2 * m; j++, cerr << " ")
            cerr << c[i][j];*/
    memset(d, 0, sizeof(d));
    for (int i = 0; i < n; i++)
        d[a[i]][b[i]]++;
    for (int s = 2 * m; s >= 2; s--)
        for (int i = 1; i < min(s, m + 1); i++)
        {
            int j = s - i;
            if (j <= 0 || j > m) continue;
            d[i - 1][j] += d[i][j];
            if (d[i - 1][j] >= MD) d[i - 1][j] -= MD;
            d[i][j - 1] += d[i][j];
            if (d[i][j - 1] >= MD) d[i][j - 1] -= MD;
            d[i][j] = 0;
        }
    /*for (int i = 0; i <= m; i++, cerr << "\n")
        for (int j = 0; j <= m; j++, cerr << " ")
            cerr << d[i][j];*/
    for (int j = 0; j <= m; j++) // (0, j)
    {
        f[0][j] = 0;
        for (int x = 0; x <= m; x++) // (x, 0) -- > (x + j, j)
            if (d[x][0] != 0)
            {
                f[0][j] += (ll)d[x][0] * (ll)c[x][j];
                if (f[0][j] >= MOD2) f[0][j] -= MOD2;
            }
        for (int x = 1; x <= m; x++) // (0, x) -- > (x + j, 0)
            if (d[0][x] != 0)
            {
                f[0][j] += d[0][x];
                if (f[0][j] >= MOD2) f[0][j] -= MOD2;
            }
        f[0][j] %= MOD;
    }
    for (int j = 0; j <= m; j++) // (j, 0)
    {
        f[j][0] = 0;
        for (int x = 0; x <= m; x++) // (x, 0) -- > (x + j, 0)
            if (d[x][0] != 0)
            {
                f[j][0] += d[x][0];
                if (f[j][0] >= MOD2) f[j][0] -= MOD2;
            }
        for (int x = 1; x <= m; x++) // (0, x) -- > (x + j, x)
            if (d[0][x] != 0)
            {
                f[j][0] += (ll)d[0][x] * (ll)c[x][j];
                if (f[j][0] >= MOD2) f[j][0] -= MOD2;
            }
        f[j][0] %= MOD;
    }
    for (int s = 2; s <= 2 * m; s++)
        for (int i = 1; i < min(m + 1, s); i++)
        {
            int j = s - i;
            if (j <= 0 || j > m) continue;
            f[i][j] = f[i - 1][j] + f[i][j - 1];
            if (f[i][j] >= MD) f[i][j] -= MD;
        }
    ll ans = 0;
    for (int i = 0; i < n; i++)
        ans += f[a[i]][b[i]];
    for (int i = 0; i < n; i++)
        ans -= c[2 * a[i]][2 * b[i]];
    ans %= MOD;
    if (ans < 0) ans += MOD;
    if (ans & 1)
        ans = (ans + MOD) / 2;
    else
        ans /= 2;
    cout << ans;
    return 0;
}

Measured memory_bytes: 112000