N = input() score = list(map(int, input().split())) winner = input().split() solved = sum([a for a, b in zip(score, winner) if b != "0"]) k_score = sum([a for a, b in zip(score, winner) if b == "0"]) if k_score >= solved: print("YES") else: print("NO")