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 n
let _ = Array.(iter (fun d -> replace h d @@ try find h d + 1 with _ -> 1) ds;
  iter (fun t -> let c = try find h t - 1 with _ -> -1 in if c < 0 then (print_endline "NO"; exit 0); replace h t c) ts); print_endline "YES"