open Hashtbl
let n = Scanf.scanf " %d" (+) 0
let ds = Array.init n @@ fun _ -> Scanf.scanf " %d" (+) 0
let m = Scanf.scanf " %d" (+) 0
let ts = Array.init m @@ fun _ -> Scanf.scanf " %d" (+) 0
let h = create 200000
let _ = Array.iter (fun t -> if mem h t then replace h t @@ find h t + 1 else add h t 1) ts;
  Array.iter (fun d -> if mem h d then replace h d @@ max 0 @@ find h d - 1) ds;
  iter (fun _ c -> if c <> 0 then (print_endline "NO"; exit 0)) h; print_endline "YES"