readLine()!
var D = readLine()!.characters.split(" ").map{Int(String($0))}
readLine()!
let T = readLine()!.characters.split(" ").map{Int(String($0))}
var ans = "YES"
for i in T {
  if let index = D.indexOf(i) {
    D.removeAt(index)
  } else {
    ans = "NO"
    break
  }
}
print(ans)