#include usingnamespace std; #defineintlonglong #definemod1000000007 #defineMAX2000 int a[200005], b[200005]; int fac[8005], inv[8005]; int f[4005][4005]; int n;intqkpow(int x,int y ){int ans =1;while( y ){if( y &1) ans = ans * x % mod;x = x * x % mod;y >>=1;}return ans; }intC(int n,int m ){if( n < m )return0;elsereturn fac[n]* inv[m]% mod * inv[n - m]% mod; }signedmain(){scanf("%lld",&n );for(int i =1;i <= n;i ++){scanf("%lld %lld",&a[i],&b[i]);f[MAX - a[i]][MAX - b[i]]++;}fac[0]= inv[0]=1;for(int i =1;i <=(MAX <<2);i ++) fac[i]= fac[i -1]* i % mod;inv[MAX <<2]=qkpow( fac[MAX <<2], mod -2);for(int i =(MAX <<2)-1;i;i --) inv[i]= inv[i +1]*( i +1)% mod;for(int i =0;i <=(MAX <<1);i ++)for(int j =0;j <=(MAX <<1);j ++){if( i )( f[i][j]+= f[i -1][j])%= mod;if( j )( f[i][j]+= f[i][j -1])%= mod;}int ans =0, cnt =0;for(int i =1;i <= n;i ++){( cnt +=C( a[i]+ b[i]<<1, a[i]<<1))%= mod;( ans += f[MAX + a[i]][MAX + b[i]])%= mod;}printf("%lld\n",( ans - cnt + mod )% mod *qkpow(2, mod -2)% mod );return0; }