#include using namespace std; int main(void) { int n, a[101] = { 0 }, u[101] = { 0 }, i; cin >> n; for (i = 0; i < n; i++){ cin >> a[i]; } for (i = 0; i < n; i++){ int b; cin >> b; u[b] += a[i]; } for (i = 1; i < 101; i++){ if (u[0] < u[i]){ cout << "NO" << endl; return 0; } } cout << "YES" << endl; return 0; }