integer(8) N
integer(8),allocatable,dimension(:)::work,dead
integer(8) timeline
read*,N
allocate(work(N),dead(N))
do i=1,N
  read*,work(i),dead(i)
end do

call heapsort(n,dead,work)

timeline=0
!$omp parallel
do i=1,N
  timeline=timeline+work(i)
  if(timeline>dead(i))then
    print"(A)","No"
    Stop
  end if
end do
!$omp end parallel

print"(A)","Yes"

contains

subroutine heapsort(n,array,b)
  implicit none
  integer(8),intent(in) :: n
  integer(8),intent(inout) :: array(1:n),b(1:n)
  integer(8)::i,k,j,l
  integer(8):: t,tb

  l=n/2+1
  k=n
  !$omp parallel
  do while(k /= 1)
     if(l > 1)then
        l=l-1
        t=array(L)
        tb=b(L)
     else
        t=array(k)
        tb=b(k)
        array(k)=array(1)
        b(k)=b(1)
        k=k-1
        if(k == 1) then
           array(1)=t
           b(1)=tb
           exit
        endif
     endif
     i=l
     j=l+l
     do while(j<=k)
        if(j < k)then
           if(array(j) < array(j+1))j=j+1
        endif
        if (t < array(j))then
           array(i)=array(j)
           b(i)=b(j)
           i=j
           j=j+j
        else
           j=k+1
        endif
     enddo
     array(i)=t
     b(i)=tb
  enddo
  !$omp end parallel
  return
end subroutine heapsort
end
