N = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) score = 0 other_score = 0 for i in range(N): if b[i] == 0: score += a[i] else: other_score += a[i] if score >= other_score: print("YES") else: print("NO")