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

read(*,*) n
allocate( a(n) )
allocate( b(n) )
do i = 1, n
   read(*,*) a(i), b(i)
end do
call heapsort(n, b, a)
do i = 1, n
   if(sum(a(1:i)) .gt. b(i) ) then
      write(*,*) 'No'
      stop
   end if
end do
write(*,*) 'Yes'

stop
contains
subroutine heapsort(n,aa,bb)
  implicit none
  integer,intent(in) :: n
  integer,intent(inout) :: aa(n), bb(n)
  integer ::i,k,j,l
  integer :: t, s

  l=n/2+1
  k=n
  do while(k.ne.1)
     if(l.gt.1)then
        l=l-1
        t=aa(L)
        s =bb(l)
     else
        t=aa(k)
        aa(k) =aa(1)
        s = bb(k)
        bb(k) = bb(1)
        k=k-1
        if(k.eq.1) then
           aa(1) = t
           bb(1) = s
           exit
        end if
     end if
     i=l
     j=l+l
     do while(j.le.k)
        if(j.lt.k)then
           if(aa(j).lt.aa(j+1))j=j+1
        end if
        if (t.lt.aa(j))then
           aa(i)=aa(j)
           bb(i)=bb(j)
           i=j
           j=j+j
        else
           j=k+1
        end if
     end do
     aa(i)=t
     bb(i)=s
  end do
end subroutine heapsort

end program main
