{-# OPTIONS_GHC -fno-warn-unused-binds -O2 #-}

import           Data.ByteString.Char8          ( ByteString )
import qualified Data.ByteString.Char8         as BS
import           Data.Vector.Unboxed            ( Vector )
import qualified Data.Vector.Unboxed           as V
import qualified Data.Vector.Algorithms.Intro  as VA
import           Data.Maybe                     ( fromJust )
import           Data.Ord                       ( comparing )

-- pipeline operator
infixl 1 |>
(|>) :: a -> (a -> b) -> b
(|>) a f = f a

readInt :: ByteString -> Int
-- readInt = fst . fromJust . BS.readInt
readInt s = s |> BS.readInt |> fromJust |> fst

readInt2 :: ByteString -> (Int, Int)
readInt2 s = s |> BS.words |> map readInt |> tup2

readInt3 :: ByteString -> (Int, Int, Int)
readInt3 s = s |> BS.words |> map readInt |> tup3

readLnInt :: IO Int
readLnInt = readInt <$> BS.getLine

readLnInts :: IO (Vector Int)
readLnInts = readInts <$> BS.getLine
  where readInts s = s |> BS.words |> map readInt |> V.fromList

tup2 :: [a] -> (a, a)
tup2 [x, y] = (x, y)
tup2 _      = undefined

tup3 :: [a] -> (a, a, a)
tup3 [x, y, z] = (x, y, z)
tup3 _         = undefined

sort :: (V.Unbox a, Ord a) => Vector a -> Vector a
sort = V.modify VA.sort

sortBy :: V.Unbox a => VA.Comparison a -> Vector a -> Vector a
sortBy c = V.modify $ VA.sortBy c

sortOn :: (V.Unbox a, Ord b) => (a -> b) -> Vector a -> Vector a
sortOn f = sortBy (comparing f)

main :: IO ()
main = do
  n      <- readLnInt
  (a, b) <- V.unzip <$> V.replicateM n (readInt2 <$> BS.getLine)
  putStrLn $ if solve a b then "Yes" else "No"

solve :: Vector Int -> Vector Int -> Bool
solve a b = V.foldl f (True, 0) ab |> fst
 where
  f (res, t) (a_i, b_i) = (res && b_i - t >= a_i, t + a_i)
  ab = sortOn snd $ V.zip a b
