N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) L = [0] * 101 for a, b in zip(A, B): L[b] += a print(['YES', 'NO'][L[0] < max(L)])