#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]; } reverse(a+1, a+n); cout << ((s[0]>=s[1])?"YES":"NO") << endl; }