n=input();l=[0]*101 a,b=list(map(int, input().split()) for _ in '11') for i,j in zip(a,b): l[j] += i print('YES' if l[0]>=max(l[1:101]) else 'NO')