# include<bits/stdc++.h>
# define LL long long
using namespace std;
const int mod=1e9+7,MAX=4e3+5,MAXN=2e5+1,TT=2e3+1;
const LL inv2=5e8+4;
struct p{
	int a,b;
}a[MAXN];
int n;
LL ans;
LL c[MAX][MAX],cc[MAX][MAX];
int main()
{
	
	scanf("%d",&n);
	for(int i=1;i<=n;++i)
	  scanf("%d%d",&a[i].a,&a[i].b),++c[TT-a[i].a][TT-a[i].b];
	cc[1][1]=1;
	for(int i=1;i<MAX;++i)
	  for(int j=1;j<MAX;++j)
	    if(i!=1||j!=1) cc[i][j]=(cc[i-1][j]+cc[i][j-1])%mod,c[i][j]=(c[i][j]+c[i-1][j]+c[i][j-1])%mod;
	for(int i=1;i<=n;++i)
	  ans=(ans+c[TT+a[i].a][TT+a[i].b]-cc[a[i].a+a[i].a+1][a[i].b+a[i].b+1]+mod)%mod;
	return printf("%lld",ans*inv2%mod),0;
}