#include using namespace std; #define int long long signed main(){ int N; cin>>N; vector A(N),B(N); for(int i=0;i>A[i]; for(int i=0;i>B[i]; vector S(102); for(int i=0;i T=S; sort(S.rbegin(),S.rend()); if(S[0] == T[0]) cout<<"YES"<