use std::io::*; fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let n: usize = itr.next().unwrap().parse().unwrap(); let a: Vec = (0..n) .map(|_| itr.next().unwrap().parse().unwrap()) .collect(); let b: Vec = (0..n) .map(|_| itr.next().unwrap().parse().unwrap()) .collect(); let mut memo: Vec = vec![0; 101]; for i in 0..n { memo[b[i]] += a[i]; } let mut ok = true; for i in 1..101 { if memo[0] < memo[i] { ok = false; } } println!("{}", if ok { "YES" } else { "NO" }) }