n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) c = [0] * 101 for i, j in zip(a, b): c[j] += i print("YES" if c[0] >= max(c[1:]) else "NO")