#include using namespace std; int main(){ int n; cin >> n; int a[n],b[n]; for(int i=0;i> a[i]; for(int i=0;i> b[i]; int k=0,l=0; for(int i=0;il)l=a[i];} } if(k>=l)cout << "YES" << endl; else cout << "NO" << endl; return 0; }