#include #include #define REP(i,n) for(int i=0;i> n; REP(i,n) cin >> a[i]; REP(i,n){ cin >> b; s[b]+=a[i]; } FOR(i,1,n+1){ if(s[0] < s[i]){ cout << "NO"; break; }else if(i==n) cout << "YES"; } cout << endl; }