n = gets.to_i
a = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)

def search(a, b)
  a.sort.zip(b.sort).each do |twin|
    return 'No' if twin[0] > twin[1]
  end
  'Yes'
end

answer = search(a, b)

puts answer
