object Main extends App {
  val N = readInt
  var as = readLine.split(" ").map(_.toInt).sorted
  var bs = readLine.split(" ").map(_.toInt).sorted

  var ans = "Yes"
  for(i <- 0 until N) {
    if(as(i) > bs(i)) {
      ans == "No"
    }
  }
  println(ans)
}
