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