N = int(input()) score = list(map(int, input().split())) winner = list(map(int, input().split())) result = [sum([b for a, b in list(zip(winner, score)) if a == i]) for i in range(101)] if result[0] >= max(result): print("YES") else: print("NO")