input() s=[int(i)for i in input().split()] p=[int(i)for i in input().split()] x=[i for i in zip(p,s)] data = {} for i in x: if i[0] not in data: data[i[0]] = i[1] else: data[i[0]] += i[1] print("YNEOS"[data[0] < max(data.values())::2])