import Data.Ratio
import Control.Monad( replicateM)
import Data.List( delete)
import Control.Applicative( (<$>))
main = do
    n <- readLn
    let meatVegi = do
	    [m,v] <- return . map read . words =<< getLine
	    return (m,v)
    mvs <- replicateM n meatVegi 
    let res = foldl (\sum mv -> sum + mkBBQ mv) 0 $ combis mvs 2
    print $ res`mod`(10^9+7)
	    

combis::[a] -> Int -> [[a]]
combis _ 0 = [[]]
combis [] _ = []
combis (x:xs) r = ( (x:) <$> combis xs (r-1) ) ++ (combis xs r)
	

mkBBQ::[(Int,Int)] -> Integer
mkBBQ [(m1,v1),(m2,v2)] =
  let	total = meats + vegis
	meats = fromIntegral m1+ fromIntegral m2
	vegis = fromIntegral v1+ fromIntegral v2
  in numerator $ (frc total) / (frc meats * frc vegis)
    where
	frc::Rational -> Rational
	frc 0 = 1
	frc n =  n*frc (n-1)