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

min_idx = a.zip(b,[*0...n]).min_by{|ai,bi,i|[bi<ai ? 10e10 : bi-ai,bi]}[2]
a.delete_at(min_idx)
b.delete_at(min_idx)

puts a.sort.zip(b.sort).any?{|ai,bi|ai>bi} ? "No" : "Yes"