#include #include #include #include #include using namespace std; #define REP(i,a,b) for(i=a;i> n; rep(i,n) { cin >> a[i]; if(max < a[i]) max = a[i]; } rep(i,n) { cin >> b; if(b == 0) sum += a[i]; } if(max > sum) cout << "NO\n"; else cout << "YES\n"; return 0; }