loop do
    n = gets.to_i
    break if n == 0
    weight, capacity = (1..n).map { gets.split.map(&:to_i) }.transpose
    weight_sum = [0]
    (1..2**n-1).each do |x|
        (0..n-1).each do |i|
            if x[i] == 1
                y = x - (1 << i)
                weight_sum[x] = weight_sum[y] + weight[i]
            end
        end
    end
    tab = [true]
    (1..2**n-1).each do |x|
        tab[x] = false
        (0..n-1).each do |i|
            if x[i] == 1
                y = x - (1 << i)
                if tab[y] && weight_sum[x] <= capacity[i]
                    tab[x] = true
                    break
                end
            end
        end
    end
    puts tab[-1] ? 'Yes' : 'No'
end

