object Main extends App {
	
	val N = scala.io.StdIn.readInt
	val a = scala.io.StdIn.readLine.split(" ").map(_.toLong).sorted
	val b = scala.io.StdIn.readLine.split(" ").map(_.toLong).sorted

	var flag = true

	for(i<-0 until N){
		if(a(i) > b(i)) flag = false
	}

	if(flag) println("Yes")
	else println("No")

}
