#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <functional>
#include <iostream>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n;
int a[200001],b[200001];
ll dp[4005][4005];
ll dp2[4005][4005];
int main(void){
	int ma=2000,mb=2000;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d%d",&a[i],&b[i]);
		dp[ma-a[i]][mb-b[i]]++;
	}
	for(int i=0;i<=ma*2;i++){
		for(int j=0;j<=mb*2;j++){
			dp[i+1][j]+=dp[i][j];
			dp[i+1][j]%=MOD;
			dp[i][j+1]+=dp[i][j];
			dp[i][j+1]%=MOD;
		}
	}
	dp2[0][0]=1;
	for(int i=0;i<=ma*2;i++){
		for(int j=0;j<=mb*2;j++){
			dp2[i+1][j]+=dp2[i][j];
			dp2[i+1][j]%=MOD;
			dp2[i][j+1]+=dp2[i][j];
			dp2[i][j+1]%=MOD;
		}
	}
	ll res=0;
	for(int i=0;i<n;i++){
		res=(res+dp[a[i]+ma][b[i]+mb])%MOD;
	}
	for(int i=0;i<n;i++){
		res=(res-dp2[a[i]*2][b[i]*2]+MOD)%MOD;
	}
	printf("%lld\n",res*500000004LL%MOD);
	return 0;
}
