let R() = stdin.ReadLine().Split(' ') |> Array.map int
stdin.ReadLine() |> ignore
let S =
    Array.zip (R()) (R())
    |> Array.groupBy snd
    |> Array.map (fun (n,arr) -> n, Array.sumBy fst arr)
let K =
    Array.tryFind (fst >> (=)0) S
    |> function
    | Some (_,s) -> s
    | None -> 0
if Array.exists (snd >> (<)K) S then "NO"
else "YES"
|> printfn "%s"