N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) x = [0] * 100 s = 0 for i, b in enumerate(B): if b == 0: s += A[i] else: x[i] += A[i] print('YES' if max(x) <= s else 'NO')