n = input() a = map(int, raw_input().split()) b = map(int, raw_input().split()) score = 0 c = [] for i in range(len(a)): if b[i] == 0: score += a[i] else: c.append(a[i]) if len(c) == 0: print "YES" elif score >= min(c): print "YES" else: print "NO"