open Printf
open Scanf

let () =
  let n = scanf "%d " (fun x -> x) in
  let tb = Hashtbl.create n in
  let rec read x =
    if x = 0 then ()
    else let d = scanf "%d " (fun i -> i) in
         if Hashtbl.mem tb d then Hashtbl.replace tb d (1 + Hashtbl.find tb d)
         else Hashtbl.add tb d 1;
         read (x - 1) in
  read n;
  let m = scanf "%d " (fun x -> x) in
  let rec check x =
    if x = 0 then "YES"
    else let t = scanf "%d " (fun i -> i) in
         if Hashtbl.mem tb t then
           let v = Hashtbl.find tb t in
           if v = 0 then "NO"
           else begin Hashtbl.replace tb t (v - 1); check (x - 1) end
         else "NO" in
  check m |> printf "%s\n"
