let solve a_seq b_seq = let ab_seq = Seq.zip a_seq b_seq let other_score = Seq.filter (fun (a, b) -> b <> 0) ab_seq |> Seq.groupBy (fun (a, b) -> b) |> Seq.map (fun (b, ab_seq) -> Seq.sumBy (fun (a, b) -> a) ab_seq) |> Seq.maxBy id let k_score = Seq.filter (fun (a, b) -> b = 0) ab_seq |> Seq.sumBy (fun (a, b) -> a) if k_score >= other_score then "YES" else "NO" let () = let _ = stdin.ReadLine() let a_lst = stdin.ReadLine().Split() |> Seq.map int let b_lst = stdin.ReadLine().Split() |> Seq.map int solve a_lst b_lst |> printfn "%s"