#include<cstdio>
#define ll long long
const int NUM=2e5+5,N=4005,mo=1e9+7,inv2=mo+1>>1;
int num,nx,mx,n,m,i,j,f[N][N],ans;
struct arr{int x,y;}a[NUM];
int read(){
	char c=getchar();int k=0;for (;c<48||c>57;c=getchar());
	for (;c>47&&c<58;c=getchar()) k=(k<<3)+(k<<1)+c-48;return k;
}
int g[N][N];
void init(){
	for (i=0;i<=n;i++) g[i][0]=1;
	for (i=1;i<=m;i++) g[0][i]=1;
	for (i=1;i<=n;i++) for (j=1;j<=m;j++)
		g[i][j]=(g[i-1][j]+g[i][j-1])%mo;
}
int main(){
	for (num=read(),i=1;i<=num;i++){
		a[i]=(arr){read(),read()};
		if (a[i].x>nx) nx=a[i].x;
		if (a[i].y>mx) mx=a[i].y;
	}
	nx++;mx++;n=nx*2;m=mx*2;init();
	for (i=1;i<=num;i++)
		f[nx-a[i].x][mx-a[i].y]++;
	for (i=1;i<=n;i++) for (j=1;j<=m;j++)
		f[i][j]=((ll)f[i][j]+f[i-1][j]+f[i][j-1])%mo;
	for (i=1;i<=num;i++){
		ans=(ans+f[a[i].x+nx][a[i].y+mx])%mo;
		ans=(ans-g[a[i].x*2][a[i].y*2])%mo;
	}
	printf("%d",((ll)ans*inv2%mo+mo)%mo);
}