#include "bits/stdc++.h" #define REP(i,n,N) for(ll i=(n); i<(N); i++) #define RREP(i,n,N) for(ll i=(N-1); i>=n; i--) #define CK(n,a,b) ((a)<=(n)&&(n)<(b)) #define ALL(v) (v).begin(),(v).end() #define p(s) cout<<(s)<> typedef long long ll; using namespace std; const ll inf=1e18; ll N; int main(){ while(cin>>N){ ll a[110]={}; ll b[110]={}; ll hito[110]={}; REP(i,0,N){ cin>>a[i]; } REP(i,0,N){ cin>>b[i]; } REP(i,0,N){ hito[b[i]]+=a[i]; } bool ok=true; REP(i,1,101){ if(hito[i]>hito[0]){ ok=false; } } p(ok?"YES":"NO"); } return 0; }