def ILI(): return list(map(int, input().split())) n = int(input()) a = ILI() b = ILI() ans =0 lis =[0 for i in range(100)] for i in zip(a,b): if i[1]==0: ans+=i[0] else: lis[i[1]]+=i[1] if max(lis)<=ans: print("YES") else: print("NO")