a[202],b[99],n,k=101;main(i){for(;~scanf("%d",a+i)?n=++i/2:--i>n?b[a[i]]+=a[i+~n]:b[--k]<=*b;);puts(k>0?"NO":"YES");}