program main
implicit none
integer :: n
integer , allocatable :: a(:), b(:), c(:), d(:)
integer :: i, j

read(*,*) n
allocate( a(n) )
allocate( b(n) )
allocate( c(n) )
allocate( d(n) )
do i = 1, n
   read(*,*) a(i), b(i)
end do
call bubble(n, b, a, d, c)
do i = 1, n

   j = n+1-i
   if( sum(c(1:j)) .gt. d(j))then
      write(*,*) 'No'
      stop
   end if
end do
write(*,*) 'Yes'
stop
contains
  subroutine bubble(n,a,b,aa,bb)
    implicit none
    integer , intent(in) :: n, a(n), b(n)
    integer , intent(out) :: aa(n), bb(n)
    integer :: i, j
    integer :: t, s

    aa = a
    bb = b
    do i = 1, n-1
       do j = i+1 , n
          if(aa(i).gt.aa(j))then
             t = aa(i)
             aa(i) = aa(j)
             aa(j) = t
             s = bb(i)
             bb(i) = bb(j)
             bb(j) = s
          end if
       end do
    end do
  end subroutine bubble

end program main
