program kadai
implicit none
integer  ::  n
integer,allocatable  ::  a(:,:)
integer  ::  i,j,time

read(*,*) n
allocate(a(2,n))
read(*,*) a

time=0
j=0
do i=1,n
    j=minloc(a(2,:),1)
    time=time+a(1,j)
    if (time>a(2,j)) then
        write(*,*) "No"
        stop
    end if
    a(2,j)=1000000001
end do
write(*,*) "Yes"
stop


end program kadai