program main
    implicit none
    integer N, d, dif, x, y, i, j
    integer, allocatable :: a(:), b(:)

    read(*,*) N
    allocate(a(N), b(N))
    read(*,*) a(:)
    read(*,*) b(:)

    d = sum(b)-sum(a)

    dif=0
    x=0
    y=0
    do i = 1,N
        if(a(i)/=b(i))then
            dif=dif+1
        endif
    enddo

    if(d<dif)then
        write(*,*) 'No'
        stop
    endif

    write(*,*) 'Yes'

end program