/*-------------icalFikr's template v2.2--------------*/

#include <iostream>
#include <cstdio>
#include <fstream>
#include <string>
#include <cstring>
#include <vector>
#include <list>
#include <map>
#include <bitset>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <algorithm>
#include <iomanip>
#include <cstddef>
#include <cassert>
#include <cctype>
#include <utility>
#include <ctime>

#ifndef GEDEBUG
	#define DEBUG printf(__VA_ARGS__)
	#define DEBUGS puts("gukguk")
	#define TIME() printf("\nFinished in %.3lf s\n",clock()/(double)CLOCKS_PER_SEC)
#endif

/* Abbreviations */
#define puf push_front
#define pof pop_front()
#define pub push_back
#define pob pop_back()
#define fs first
#define sc second
#define mp make_pair
#define FOR(i,a,b) for(int i=int(a),_b=int(b);i<=_b;i++)
#define FORINC(i,a,b,inc) for(int i=int(a),_b=int(b);i<=_b;i+=inc)
#define FORLL(i,a,b) for(LL i=LL(a),_b=LL(b);i<=_b;i++)
#define FORD(i,a,b) for(int i=int(a),_b=int(b);i>=_b;i--)
#define FOREACH(i,a) for (__typeof(a.begin()) i=a.begin();i!=a.end();i++)
#define OPEN freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
#define CLOSE fclose(stdin); fclose(stdout);
#define ALL(v) (v).begin(),(v).end()
#define sz size()
#define reset(x,N) memset(x,N,sizeof(x))
#define nl puts("")
#ifdef __WIN32__
    #define gc getchar()
#else
    #define gc getchar_unlocked()
#endif

using namespace std;
typedef double db;
typedef long long LL;
typedef pair <int,int> ii;
typedef pair <LL,LL> pll;
typedef vector <ii> vii;
typedef vector <int> vint;

const db EPS	= 0.0000001;
const db PI 	= acos(-1);
const LL INFLL	= 0x7FFFFFFFFFFFFFFF;
const int INF	= 0x7FFFFFFF;

template<typename T>
inline void next(T &num) {
    char c; num=0;
    do { c=gc; }
    while (c!=EOF && c==' ' && c=='\n' && c=='\t');
    int sign=(c=='-' ? -1 : 1);
    if (c!='-') num+=(c-'0');
    while ( (c=gc)!=EOF && c!='\n' && c!='\t' && c!=' ') {
        num*=10; num+=(c-'0');
    }
    num*=sign;
}

inline string getstr() {
    string str; char k;
    while( (k=gc)==' ' || k=='\n' ) {
        k=gc;
        if ( k==' ' || k=='\n' ) continue;
        else break;
    }
	str.pub(k);
    while((k=gc)!=EOF &&k!='\n' && k!='\t'
        && k!='\v' && k!='\0' && k!=' ')
        str.pub(k);
    return str;
}

/*-------------end of template-------------*/
int a[100005], n;
bool _inc = 1, _dec = 1;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	#ifndef ONLINE_JUDGE
		//freopen("input.txt","rt",stdin);
	#endif

    cin >> n;
    FOR(i,0,n-1) cin >> a[i];

    if (n < 3) cout << -1;
    else {
        FOR(i,1,n-1) {
            _inc &= (a[i] >= a[i-1]);
            _dec &= (a[i] <= a[i-1]);
        }

        int j=0;
        for(; j<n && a[j]==a[0]; ++j);

        if (!_inc && !_dec) cout << 1 << ' ' << n;
        else {
            if (j<n) cout << 1 << ' ' << j+1;
            else cout << -1;
        }
    }
	return 0;
}


/*-------------icalFikr's template v2.2--------------*/

#include <iostream>
#include <cstdio>
#include <fstream>
#include <string>
#include <cstring>
#include <vector>
#include <list>
#include <map>
#include <bitset>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <algorithm>
#include <iomanip>
#include <cstddef>
#include <cassert>
#include <cctype>
#include <utility>
#include <ctime>

#ifndef GEDEBUG
	#define DEBUG printf(__VA_ARGS__)
	#define DEBUGS puts("gukguk")
	#define TIME() printf("\nFinished in %.3lf s\n",clock()/(double)CLOCKS_PER_SEC)
#endif

/* Abbreviations */
#define puf push_front
#define pof pop_front()
#define pub push_back
#define pob pop_back()
#define fs first
#define sc second
#define mp make_pair
#define FOR(i,a,b) for(int i=int(a),_b=int(b);i<=_b;i++)
#define FORINC(i,a,b,inc) for(int i=int(a),_b=int(b);i<=_b;i+=inc)
#define FORLL(i,a,b) for(LL i=LL(a),_b=LL(b);i<=_b;i++)
#define FORD(i,a,b) for(int i=int(a),_b=int(b);i>=_b;i--)
#define FOREACH(i,a) for (__typeof(a.begin()) i=a.begin();i!=a.end();i++)
#define OPEN freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
#define CLOSE fclose(stdin); fclose(stdout);
#define ALL(v) (v).begin(),(v).end()
#define sz size()
#define reset(x,N) memset(x,N,sizeof(x))
#define nl puts("")
#ifdef __WIN32__
    #define gc getchar()
#else
    #define gc getchar_unlocked()
#endif

using namespace std;
typedef double db;
typedef long long LL;
typedef pair <int,int> ii;
typedef pair <LL,LL> pll;
typedef vector <ii> vii;
typedef vector <int> vint;

const db EPS	= 0.0000001;
const db PI 	= acos(-1);
const LL INFLL	= 0x7FFFFFFFFFFFFFFF;
const int INF	= 0x7FFFFFFF;

template<typename T>
inline void next(T &num) {
    char c; num=0;
    do { c=gc; }
    while (c!=EOF && c==' ' && c=='\n' && c=='\t');
    int sign=(c=='-' ? -1 : 1);
    if (c!='-') num+=(c-'0');
    while ( (c=gc)!=EOF && c!='\n' && c!='\t' && c!=' ') {
        num*=10; num+=(c-'0');
    }
    num*=sign;
}

inline string getstr() {
    string str; char k;
    while( (k=gc)==' ' || k=='\n' ) {
        k=gc;
        if ( k==' ' || k=='\n' ) continue;
        else break;
    }
	str.pub(k);
    while((k=gc)!=EOF &&k!='\n' && k!='\t'
        && k!='\v' && k!='\0' && k!=' ')
        str.pub(k);
    return str;
}

/*-------------end of template-------------*/
int a[100005], last[100005], n;
bool _inc = 1, _dec = 1;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    #ifndef ONLINE_JUDGE
        //freopen("input.txt","rt",stdin);
    #endif

    cin >> n;
    FOR(i,0,n-1) cin >> a[i];

    last[n-1] = n-1;
    FORD(i,n-2,0) last[i] = a[i] == a[i+1] ? last[i+1] : i;

    if (n < 3) { cout << -1; return 0; }

    FOR(i,1,n-1) {
        _inc &= (a[i] >= a[i-1]);
        _dec &= (a[i] <= a[i-1]);
    }

    if ((_inc || _dec))
        if (a[0] != a[n-1]) {
            FOR(i,0,n-2)
                if (a[i] != a[i+1]) {
                    cout << i+1 << ' ' << i+2;
                    return 0;;
                }
        } else { cout << -1; return 0; }

    if (n < 4) {
        FOR(i,0,1) FOR(j,i+1,2)
        if (a[i] != a[j]) {
            swap(a[i],a[j]);
            _inc = 1, _dec = 1;

            FOR(i,1,2) {
                _inc &= (a[i] >= a[i-1]);
                _dec &= (a[i] <= a[i-1]);
            }

            if (!_inc && !_dec) {
                cout << i + 1 << ' ' << j + 1;
                return 0;
            } else swap(a[i],a[j]);
        }
        cout << -1;
        return 0;
    }

    FORD(i,n-1,1)
    if (a[0] != a[i]) {
        cout << last[0] + 1 << ' ' << i + 1;
        break;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
	// your code goes here
	int n;cin>>n;
	int a[n*2];
	for(int x=0;x<2*n;x++){
		cin>>a[x];
	}
	sort(a,a+2*n);
	int ok=1;
	for(int i=0;i<n;i++){
		if(a[i]==a[i+n]){
			ok=0;
			break;
		}
	}
	if(ok)cout<<"YES\n";
	else cout<<"NO\n";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
	// your code goes here
	int n;cin>>n;
	int a[n*2];
	for(int x=0;x<2*n;x++){
		cin>>a[x];
	}
	sort(a,a+2*n);
	int ok=1;vector<int>v1,v2;
	for(int i=0;i<2*n;i+=2){
		v1.push_back(max(a[i],a[i+1]));
		v2.push_back(min(a[i],a[i+1]));
	}
	sort(v1.begin(),v1.end());
	sort(v2.begin(),v2.end());
	for(int i=0;i<n;i++){
		if(v1[i]==v2[i]){
			ok=0;
			break;
		}
	}
	if(ok)cout<<"YES\n";
	else cout<<"NO\n";

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
	// your code goes here
	int n;cin>>n;
	int a[n*2];
	for(int x=0;x<2*n;x++){
		cin>>a[i];
	}
	sort(a,a+2*n);
    int ok=1;
    for(int i=0;i<n;i++){
        if(a[i]==a[i+n]){
            ok=0;
            break;
        }
    }
    if(ok)cout<<"YES\n";
    else cout<<"NO\n";

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
	// your code goes here
	int n;cin>>n;
	int a[n*2];
	for(int x=0;x<2*n;x++){
		cin>>a[x];
	}
	sort(a,a+2*n);
//	int ok=1;vector<int>v1,v2;

	if(a[n-1]<a[n])cout<<"YES\n";
	else cout<<"NO\n";

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll i,j,k,l,m,n,arr[200010];
    cin>>n;
    for(i=0;i<2*n;i++)
        cin>>arr[i];
    sort(arr,arr+(2*n));
    for(i=0;i<n;i++)
    {
        if(arr[i]>=arr[n+i])
        {
            cout<<"NO";return 0;
        }
    }
    cout<<"YES";
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll i,j,k,l,m,n,arr[100010];
    cin>>n;
    for(i=0;i<2*n;i++)
        cin>>arr[i];
    sort(arr,arr+(2*n));
//    for(i=0;i<n;i++)
//    {
//        if(arr[i]==arr[n+i])
//        {
//            cout<<"NO";return 0;
//        }
//    }
    if(arr[n-1]==arr[n])
    cout<<"NO";
    else cout<<"YES";
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll i,j,k,l,m,n,arr[200010];
    cin>>n;
    for(i=0;i<2*n;i++)
        cin>>arr[i];
    sort(arr,arr+n);
    for(i=0;i<n;i++)
    {
        if(arr[i]>=arr[n+i])
        {
            cout<<"NO";return 0;
        }
    }
    cout<<"YES";
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll i,j,k,l,m,n,arr[200010];
    cin>>n;
    for(i=0;i<2*n;i++)
        cin>>arr[i];
    sort(arr,arr+2*n);
    for(i=0;i<n;i++)
    {
        if(arr[i]>=arr[n+i])
        {
            cout<<"NO";return 0;
        }
    }
    cout<<"YES";
}


#include <bits/stdc++.h>
#include <conio.h>
//#include "header.h"
using namespace std;
//ifstream fin("bac.in");
#define ll long long
#define MAX 100
#define ull unsigned long long

class algoritm
{
    //friend ostream &operator<<(ostream &output, const algoritm &);
    friend istream &operator>>(istream &, algoritm &);

public:

    void afisare(vector< stack< int > > sett)
    {
        for(int i=0; i<=2; i++)
        {
            cout<<sett[i].size()<<' ';

            while(!sett[i].empty())
            {
                cout<<sett[i].top()<<' ';
                sett[i].pop();

            }
            cout<<endl;
        }
    }

    void rezolvare()
    {

        int nr_poz,nr_neg,nr_0 = 0;
        vector< stack< int > > sett(3);

        for(int i=0; i<n; i++)
        {
            int x;
            cin>>x;
            if(x<0)
            {
                sett[0].push(x);
                nr_neg++;
            }
            else if(x>0)
            {

                sett[1].push(x);
                nr_poz++;
            }
            else
            {
                sett[2].push(x);
            }
        }

        while(nr_poz!=1)
        {
            int x;
            x =  sett[1].top();
            sett[1].pop();
            sett[2].push(x);
            nr_poz--;
        }

        while(nr_neg!=1)
        {
            int x;
            x =  sett[0].top();
            sett[0].pop();
            sett[2].push(x);
            nr_neg--;
        }

        afisare(sett);

    }

protected:
    int n;

};

istream &operator>>(istream &input, algoritm &alg)
{
    input>>alg.n;
    return input;

}

void afisare(vector< stack< int > > sett)
{
    for(int i=0; i<=2; i++)
    {
        cout<<sett[i].size()<<' ';

        while(!sett[i].empty())
        {
            cout<<sett[i].top()<<' ';
            sett[i].pop();

        }
        cout<<endl;
    }
}

#define LL long long
bool opt(long long n)
{
    while( n )
    {
        if(abs(n%10)==8)
        {
            return true;

        }
        n/=10;
    }
    return false;

}

void sortare(vector< pair< int, int > > &v)
{
    int n = v.size();
    for(int i=0; i<n-1; i++)
    {
        for(int j=i+1; j<n; j++)
        {
            if( v[i].first < v[j].first)
            {
                swap(v[i],v[j]);
            }
            else if( v[i].first == v[j].first )
            {
                if( v[i].second > v[j].second )
                {
                    swap(v[i],v[j]);
                }
            }
        }
    }
}

void init(char s[][102], int n)
{
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<n; j++)
        {
            s[i][j] = '0';
        }
    }

}

bool prim(int n)
{
    if(n==1)
    {
        return false;

    }

    for(int i=2; i*i<=n; i++)
    {
        if(n%i==0)
        {
            return false;
        }

    }

    return true;

}

bool numere(int n)
{
    int i,j;

    for(int i=5; i<=n; i++)
    {
        for(int j=i; j<=n; j++)
        {
            if(i*j==n)
            {
                return true;
            }
        }
    }
    return false;

}

int sum = 0;
string s;

int backtracking(int n, int nr)
{
    if( nr < 0 )
    {
        return 0;
    }

    int i;

    for(i=1; i<=26; i++)
    {
        if( i*pow(26,nr) > n )
        {
            sum+= (i-1)*pow(26,nr);
            s.push_back((char)((i-1) + 64));
            break;
        }
    }
    backtracking( n-(i-1)*pow(26,nr),nr-1);
}

bool verificare(int a[][4])
{
    int sum1,sum2,sum3;
    sum1 = 0;
    sum2 = 0;
    sum3 = 0;

    int diag1,diag2;
    diag1 =0;
    diag2 =0;

    sum1+= a[1][1]+a[1][2]+a[1][3];
    sum2+= a[2][1]+a[2][2]+a[2][3];
    sum3+= a[3][1]+a[3][2]+a[3][3];

    diag1 += a[1][1]+a[2][2]+a[3][3];
    diag2 += a[1][3]+a[2][2]+a[3][1];

    if(diag1 == diag2 && sum1==sum2 && sum1==sum3 && diag1==sum1)
    {
        return true;
    }
    return false;

}

class Person
{
protected:
    int data;
    int name;

public:

    virtual void getdata() = 0;
    /*{
        cin>>this->name>>this->data;
    }*/

    virtual void afisare() = 0;
    /*{

        cout<<this->data<<' '<<this->name;
    }*/

};

class Student:public Person
{
    int id;
public:

    void getdata()
    {
        cin>>this->name>>this->data>>this->id;
    }

    void afisare()
    {
        cout<<this->data<<' '<<this->name<<' '<<this->id;

    }
};

void sortare(vector< int > v, int m, int n)
{
    int i,j;
    for(int i=m; i<=n-1; i++)
    {
        for(int j=i+1; j<=n; j++)
        {
            if(v[i]>v[j])
            {
                swap(v[i],v[j]);
            }

        }
    }

}

bool verif(int x, int k)
{

    int vfrec[10]= {0};

    while(x)
    {

        vfrec[x%10]++;

        x/=10;
    }

    for(int i=0; i<=k; i++)
    {
        if(vfrec[i]==0)
        {
            return false;
        }
    }
    return true;
}

class strings
{
public:

    strings():str{nullptr}
    {
        str = new char[1];
        str[0] = '\0';
    }

    strings(char *s)
    {
        str = new char[strlen(s)];
        strcpy(str,s);
        str[strlen(str)] = '\0';
    }
    void getelement()
    {
        for(int i=0; i<strlen(str); i++)
        {
            cout<<str[i];
        }

    }

    friend istream &operator>>(istream &inpt, const strings& obj );

    strings &operator=(const strings &);

protected:
    char *str;

};

/*
strings&  strings::operator=(const strings& rhs)
{
    if (this == &rhs)
        return *this;
    delete[] str;
    str = new char[strlen(rhs.str) + 1];
    strcpy(str, rhs.str);
    return *this;
}
*/
/*
istream &operator>>(istream &inpt, strings& obj)
{
    char *s;
    s =  new char[1010];
    inpt>>s;
    //strcpy(obj.str,s);
    obj = strings{s};

    delete[] s;

    return inpt;
}
*/

void hanoi(int n, char source, char destination, char auxiliar)
{
    if(n>0)
    {
        n--;
        hanoi(n,source,auxiliar,destination);
        cout<<source<<' '<<destination<<endl;
        hanoi(n,auxiliar,destination,source);
    }

}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //algoritm alg;
    //cin>>alg;
    //alg.rezolvare();
    int n;
    cin>>n;
    vector< int > v;
    int nr1 = 0, nr2 = 0;

    for(int i=0; i<2*n; i++)
    {
        int x;
        cin>>x;
        v.push_back(x);

    }

    sort(v.begin(),v.end());

    if(v[n-1] < v[n])
    {
        cout<<"YES";
    }
    else
    {
        cout<<"NO";
    }

    return 0;
}


#include <bits/stdc++.h>
#include <conio.h>
//#include "header.h"
using namespace std;
//ifstream fin("bac.in");
#define ll long long
#define MAX 100
#define ull unsigned long long

class algoritm
{
    //friend ostream &operator<<(ostream &output, const algoritm &);
    friend istream &operator>>(istream &, algoritm &);

public:

    void afisare(vector< stack< int > > sett)
    {
        for(int i=0; i<=2; i++)
        {
            cout<<sett[i].size()<<' ';

            while(!sett[i].empty())
            {
                cout<<sett[i].top()<<' ';
                sett[i].pop();

            }
            cout<<endl;
        }
    }

    void rezolvare()
    {

        int nr_poz,nr_neg,nr_0 = 0;
        vector< stack< int > > sett(3);

        for(int i=0; i<n; i++)
        {
            int x;
            cin>>x;
            if(x<0)
            {
                sett[0].push(x);
                nr_neg++;
            }
            else if(x>0)
            {

                sett[1].push(x);
                nr_poz++;
            }
            else
            {
                sett[2].push(x);
            }
        }

        while(nr_poz!=1)
        {
            int x;
            x =  sett[1].top();
            sett[1].pop();
            sett[2].push(x);
            nr_poz--;
        }

        while(nr_neg!=1)
        {
            int x;
            x =  sett[0].top();
            sett[0].pop();
            sett[2].push(x);
            nr_neg--;
        }

        afisare(sett);

    }

protected:
    int n;

};

istream &operator>>(istream &input, algoritm &alg)
{
    input>>alg.n;
    return input;

}

void afisare(vector< stack< int > > sett)
{
    for(int i=0; i<=2; i++)
    {
        cout<<sett[i].size()<<' ';

        while(!sett[i].empty())
        {
            cout<<sett[i].top()<<' ';
            sett[i].pop();

        }
        cout<<endl;
    }
}

#define LL long long
bool opt(long long n)
{
    while( n )
    {
        if(abs(n%10)==8)
        {
            return true;

        }
        n/=10;
    }
    return false;

}

void sortare(vector< pair< int, int > > &v)
{
    int n = v.size();
    for(int i=0; i<n-1; i++)
    {
        for(int j=i+1; j<n; j++)
        {
            if( v[i].first < v[j].first)
            {
                swap(v[i],v[j]);
            }
            else if( v[i].first == v[j].first )
            {
                if( v[i].second > v[j].second )
                {
                    swap(v[i],v[j]);
                }
            }
        }
    }
}

void init(char s[][102], int n)
{
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<n; j++)
        {
            s[i][j] = '0';
        }
    }

}

bool prim(int n)
{
    if(n==1)
    {
        return false;

    }

    for(int i=2; i*i<=n; i++)
    {
        if(n%i==0)
        {
            return false;
        }

    }

    return true;

}

bool numere(int n)
{
    int i,j;

    for(int i=5; i<=n; i++)
    {
        for(int j=i; j<=n; j++)
        {
            if(i*j==n)
            {
                return true;
            }
        }
    }
    return false;

}

int sum = 0;
string s;

int backtracking(int n, int nr)
{
    if( nr < 0 )
    {
        return 0;
    }

    int i;

    for(i=1; i<=26; i++)
    {
        if( i*pow(26,nr) > n )
        {
            sum+= (i-1)*pow(26,nr);
            s.push_back((char)((i-1) + 64));
            break;
        }
    }
    backtracking( n-(i-1)*pow(26,nr),nr-1);
}

bool verificare(int a[][4])
{
    int sum1,sum2,sum3;
    sum1 = 0;
    sum2 = 0;
    sum3 = 0;

    int diag1,diag2;
    diag1 =0;
    diag2 =0;

    sum1+= a[1][1]+a[1][2]+a[1][3];
    sum2+= a[2][1]+a[2][2]+a[2][3];
    sum3+= a[3][1]+a[3][2]+a[3][3];

    diag1 += a[1][1]+a[2][2]+a[3][3];
    diag2 += a[1][3]+a[2][2]+a[3][1];

    if(diag1 == diag2 && sum1==sum2 && sum1==sum3 && diag1==sum1)
    {
        return true;
    }
    return false;

}

class Person
{
protected:
    int data;
    int name;

public:

    virtual void getdata() = 0;
    /*{
        cin>>this->name>>this->data;
    }*/

    virtual void afisare() = 0;
    /*{

        cout<<this->data<<' '<<this->name;
    }*/

};

class Student:public Person
{
    int id;
public:

    void getdata()
    {
        cin>>this->name>>this->data>>this->id;
    }

    void afisare()
    {
        cout<<this->data<<' '<<this->name<<' '<<this->id;

    }
};

void sortare(vector< int > v, int m, int n)
{
    int i,j;
    for(int i=m; i<=n-1; i++)
    {
        for(int j=i+1; j<=n; j++)
        {
            if(v[i]>v[j])
            {
                swap(v[i],v[j]);
            }

        }
    }

}

bool verif(int x, int k)
{

    int vfrec[10]= {0};

    while(x)
    {

        vfrec[x%10]++;

        x/=10;
    }

    for(int i=0; i<=k; i++)
    {
        if(vfrec[i]==0)
        {
            return false;
        }
    }
    return true;
}

class strings
{
public:

    strings():str{nullptr}
    {
        str = new char[1];
        str[0] = '\0';
    }

    strings(char *s)
    {
        str = new char[strlen(s)];
        strcpy(str,s);
        str[strlen(str)] = '\0';
    }
    void getelement()
    {
        for(int i=0; i<strlen(str); i++)
        {
            cout<<str[i];
        }

    }

    friend istream &operator>>(istream &inpt, const strings& obj );

    strings &operator=(const strings &);

protected:
    char *str;

};

/*
strings&  strings::operator=(const strings& rhs)
{
    if (this == &rhs)
        return *this;
    delete[] str;
    str = new char[strlen(rhs.str) + 1];
    strcpy(str, rhs.str);
    return *this;
}
*/
/*
istream &operator>>(istream &inpt, strings& obj)
{
    char *s;
    s =  new char[1010];
    inpt>>s;
    //strcpy(obj.str,s);
    obj = strings{s};

    delete[] s;

    return inpt;
}
*/

void hanoi(int n, char source, char destination, char auxiliar)
{
    if(n>0)
    {
        n--;
        hanoi(n,source,auxiliar,destination);
        cout<<source<<' '<<destination<<endl;
        hanoi(n,auxiliar,destination,source);
    }

}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //algoritm alg;
    //cin>>alg;
    //alg.rezolvare();
    int n;
    cin>>n;
    vector< int > v;
    int nr1 = 0, nr2 = 0;

    for(int i=0; i<2*n; i++)
    {
        int x;
        cin>>x;
        v.push_back(x);

    }

    sort(v.rbegin(),v.rend());

    for(int i=0; i<n; i++)
    {
        if(v[i] > v[n-i-1])
        {
            nr1++;
        }

    }

    if(nr1)
    {
        cout<<"YES";
    }
    else
    {

        cout<<"NO";
    }

    return 0;
}


//
// CODED by HARRY on 17/08/2020
//

#include<iostream>
#include<vector>
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define charToInt(c) (c-'0')

const int maxx = 0x3f3f3f3f;

int main() {
    int n;
    cin >> n;
    int a[2*n];
    for (int i = 0; i < 2*n; ++i) {
        cin >> a[i];
    }
    sort(a, a + (2*n));
    if(a[n - 1] == a[n])
        cout << "NO" << endl;
    else
        cout << "YES" << endl;
    return 0;
}


//
// CODED by HARRY on 17/08/2020
//

#include<iostream>
#include<vector>
//#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define charToInt(c) (c-'0')

const int maxx = 0x3f3f3f3f;

int main() {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < 2*n; ++i) {
        cin >> a[i];
    }
    sort(a, a + n);
    if(a[n - 1] == a[n])
        cout << "NO" << endl;
    else
        cout << "YES" << endl;
    return 0;
}


//
// CODED by HARRY on 17/08/2020
//

#include<iostream>
#include<vector>
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define charToInt(c) (c-'0')

const int maxx = 0x3f3f3f3f;

int main() {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < 2*n; ++i) {
        cin >> a[i];
    }
    sort(a, a + n);
    if(a[n - 1] == a[n])
        cout << "NO" << endl;
    else
        cout << "YES" << endl;
    return 0;
}


#include<bits/stdc++.h>
#define ri register int
#define fi first
#define se second
using namespace std;
const int rlen=1<<18|1;
inline char gc(){
	static char buf[rlen],*ib,*ob;
	(ib==ob)&&(ob=(ib=buf)+fread(buf,1,rlen,stdin));
	return ib==ob?-1:*ib++;
}
inline int read(){
	int ans=0;
	char ch=gc();
	while(!isdigit(ch))ch=gc();
	while(isdigit(ch))ans=((ans<<2)+ans<<1)+(ch^48),ch=gc();
	return ans;
}
const int N=205;
int n,a[N];
int main(){
	n=read();
	for(ri i=1;i<=n*2;++i)a[i]=read();
	sort(a+1,a+2*n+1);
	int f=0;
	for(ri i=1;i<=n;++i){
		if(a[i+n]>a[i])++f;
		else --f;
	}
	puts(f>0?"YES":"NO");
	return 0;
}


#include<bits/stdc++.h>
#define ri register int
#define fi first
#define se second
using namespace std;
const int rlen=1<<18|1;
inline char gc(){
	static char buf[rlen],*ib,*ob;
	(ib==ob)&&(ob=(ib=buf)+fread(buf,1,rlen,stdin));
	return ib==ob?-1:*ib++;
}
inline int read(){
	int ans=0;
	char ch=gc();
	while(!isdigit(ch))ch=gc();
	while(isdigit(ch))ans=((ans<<2)+ans<<1)+(ch^48),ch=gc();
	return ans;
}
const int N=105;
int n,a[N];
int main(){
	n=read();
	for(ri i=1;i<=n*2;++i)a[i]=read();
	sort(a+1,a+2*n+1);
	int f=0;
	for(ri i=1;i<=n;++i){
		if(a[2*n-i+1]>a[i])++f;
		else --f;
	}
	puts(f>0?"YES":"NO");
	return 0;
}


#include<bits/stdc++.h>
#define ri register int
#define fi first
#define se second
using namespace std;
const int rlen=1<<18|1;
inline char gc(){
	static char buf[rlen],*ib,*ob;
	(ib==ob)&&(ob=(ib=buf)+fread(buf,1,rlen,stdin));
	return ib==ob?-1:*ib++;
}
inline int read(){
	int ans=0;
	char ch=gc();
	while(!isdigit(ch))ch=gc();
	while(isdigit(ch))ans=((ans<<2)+ans<<1)+(ch^48),ch=gc();
	return ans;
}
const int N=105;
int n,a[N];
int main(){
	n=read();
	for(ri i=1;i<=n*2;++i)a[i]=read();
	sort(a+1,a+2*n+1);
	bool f=1;
	for(ri i=1;i<=n;++i){
		if(a[i+n]>a[i])continue;
		f=0;
		break;
	}
	puts(f?"YES":"NO");
	return 0;
}


#include<bits/stdc++.h>
#define ri register int
#define fi first
#define se second
using namespace std;
const int rlen=1<<18|1;
inline char gc(){
	static char buf[rlen],*ib,*ob;
	(ib==ob)&&(ob=(ib=buf)+fread(buf,1,rlen,stdin));
	return ib==ob?-1:*ib++;
}
inline int read(){
	int ans=0;
	char ch=gc();
	while(!isdigit(ch))ch=gc();
	while(isdigit(ch))ans=((ans<<2)+ans<<1)+(ch^48),ch=gc();
	return ans;
}
const int N=205;
int n,a[N];
int main(){
	n=read();
	for(ri i=1;i<=n*2;++i)a[i]=read();
	sort(a+1,a+2*n+1);
	puts(a[n]^a[n+1]?"YES":"NO");
	return 0;
}


#include<bits/stdc++.h>
#define ri register int
#define fi first
#define se second
using namespace std;
const int rlen=1<<18|1;
inline char gc(){
	static char buf[rlen],*ib,*ob;
	(ib==ob)&&(ob=(ib=buf)+fread(buf,1,rlen,stdin));
	return ib==ob?-1:*ib++;
}
inline int read(){
	int ans=0;
	char ch=gc();
	while(!isdigit(ch))ch=gc();
	while(isdigit(ch))ans=((ans<<2)+ans<<1)+(ch^48),ch=gc();
	return ans;
}
const int N=105;
int n,a[N];
int main(){
	freopen("lx.in","r",stdin);
	n=read();
	for(ri i=1;i<=n*2;++i)a[i]=read();
	sort(a+1,a+2*n+1);
	puts(a[n]^a[n+1]?"YES":"NO");
	return 0;
}


#include<bits/stdc++.h>
#define ri register int
#define fi first
#define se second
using namespace std;
const int rlen=1<<18|1;
inline char gc(){
	static char buf[rlen],*ib,*ob;
	(ib==ob)&&(ob=(ib=buf)+fread(buf,1,rlen,stdin));
	return ib==ob?-1:*ib++;
}
inline int read(){
	int ans=0;
	char ch=gc();
	while(!isdigit(ch))ch=gc();
	while(isdigit(ch))ans=((ans<<2)+ans<<1)+(ch^48),ch=gc();
	return ans;
}
const int N=205;
int n,a[N];
int main(){
	n=read();
	for(ri i=1;i<=n*2;++i)a[i]=read();
	sort(a+1,a+2*n+1);
	puts(a[n]==a[n+1]?"YES":"NO");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a;
    cin>>n;
    set<int>s;
    for(int i=0;i<2*n;i++){
        cin>>a;
        s.insert(a);
    }
    if(s.size()==1) cout<<"NO";
    else cout<<"YES";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int a[2*n];
    for(int i=0;i<2*n;i++){
        cin>>a[i];
    }
    sort(a,a+2*n);
    if(a[n]==a[n-1]) cout<<"NO";
    else cout<<"YES";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int a[2*n];
    for(int i=0;i<2*n;i++){
        cin>>a[i];
    }
    sort(a,a+n);
    if(a[n]==a[n-1]) cout<<"NO";
    else cout<<"YES";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a;
    cin>>n;
    set<int>s;
    for(int i=0;i<2*n;i++){
        cin>>a;
        s.insert(a);
    }
    if(s.size()==2*n) cout<<"YES";
    else cout<<"NO";
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
vector<long long>vprime;
void SieveOfEratosthenes(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (int p=2; p*p<=n; p
    ++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
          vprime.push_back(p);
}
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000,mi1=100000000000,mi2=100,mi3=1000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0;
    long long arr[100001],arr1[100001]={0};
    long long a1,a2,b1,b2,c1,c2,a3,a4,b3,b4,b5,b6,m1,m2,k1,l1,m3,m4,d1,d2;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    //vector<long long>v;

    vector<string>vs;
    vector<string>vs1;
    //vector<pair<long long,pair<long long, long long> > >v;
    set<long long>s;
    set<long long>s1;
    set<long long>s2;
    set<long long>s3;
    map< char,long long > mp1;
    stack<long long>st;
    list<long long>li;
    int x[]={1,-1,1,-1,2,2,-2,-2};
    int y[]={2,2,-2,-2,1,-1,1,-1};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    map< long long,long long > mp;
    map< long long,long long>::iterator it;
    vector<pair<long long,long long> >v3;
    vector<pair<long long,long long> >v4;
    cin>>n;
    vector<long long>v(2*n);
    for(int i=0; i<2*n; i++)
        cin>>v[i];
    sort(v.begin(),v.end());
    for(int i=0,j=(2*n)-1; i<n; i++,j--)
    {
        //cout<<v[i]<<" "<<v[j]<<endl;
        if(v[i]<v[j])
            co++;
    }
    if(co==n)
        cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
vector<long long>vprime;
void SieveOfEratosthenes(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (int p=2; p*p<=n; p
    ++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
          vprime.push_back(p);
}
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000,mi1=100000000000,mi2=100,mi3=1000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0;
    long long arr[100001],arr1[100001]={0};
    long long a1,a2,b1,b2,c1,c2,a3,a4,b3,b4,b5,b6,m1,m2,k1,l1,m3,m4,d1,d2;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    //vector<long long>v;

    vector<string>vs;
    vector<string>vs1;
    //vector<pair<long long,pair<long long, long long> > >v;
    set<long long>s;
    set<long long>s1;
    set<long long>s2;
    set<long long>s3;
    map< char,long long > mp1;
    stack<long long>st;
    list<long long>li;
    int x[]={1,-1,1,-1,2,2,-2,-2};
    int y[]={2,2,-2,-2,1,-1,1,-1};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    map< long long,long long > mp;
    map< long long,long long>::iterator it;
    vector<pair<long long,long long> >v3;
    vector<pair<long long,long long> >v4;
    cin>>n;
    vector<long long>v(2*n);
    for(int i=0; i<2*n; i++)
        cin>>v[i];
    sort(v.begin(),v.end());
    for(int i=0,j=n; i<n; i++,j++)
    {
        //cout<<v[i]<<" "<<v[j]<<endl;
        if(v[i]<v[j])
            co++;
    }
    if(co==n)
        cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
vector<long long>vprime;
void SieveOfEratosthenes(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (int p=2; p*p<=n; p
    ++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
          vprime.push_back(p);
}
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000,mi1=100000000000,mi2=100,mi3=1000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0;
    long long arr[100001],arr1[100001]={0};
    long long a1,a2,b1,b2,c1,c2,a3,a4,b3,b4,b5,b6,m1,m2,k1,l1,m3,m4,d1,d2;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    //vector<long long>v;

    vector<string>vs;
    vector<string>vs1;
    //vector<pair<long long,pair<long long, long long> > >v;
    set<long long>s;
    set<long long>s1;
    set<long long>s2;
    set<long long>s3;
    map< char,long long > mp1;
    stack<long long>st;
    list<long long>li;
    int x[]={1,-1,1,-1,2,2,-2,-2};
    int y[]={2,2,-2,-2,1,-1,1,-1};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    map< long long,long long > mp;
    map< long long,long long>::iterator it;
    vector<pair<long long,long long> >v3;
    vector<pair<long long,long long> >v4;
    cin>>n;
    vector<long long>v(2*n);
    for(int i=0; i<2*n; i++)
        cin>>v[i];
    sort(v.begin(),v.end());
    for(int i=0,j=(2*n)-1; i<n; i++,j--)
    {
        //cout<<v[i]<<" "<<v[j]<<endl;
        if(v[i]<v[j])
            co++;
        if(v[i]==v[j])
            co1++;
    }
    if((co+co1)==n && co!=0)
        cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
vector<long long>vprime;
void SieveOfEratosthenes(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (int p=2; p*p<=n; p
    ++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
          vprime.push_back(p);
}
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000,mi1=100000000000,mi2=100,mi3=1000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0;
    long long arr[100001],arr1[100001]={0};
    long long a1,a2,b1,b2,c1,c2,a3,a4,b3,b4,b5,b6,m1,m2,k1,l1,m3,m4,d1,d2;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    //vector<long long>v;

    vector<string>vs;
    vector<string>vs1;
    //vector<pair<long long,pair<long long, long long> > >v;
    set<long long>s;
    set<long long>s1;
    set<long long>s2;
    set<long long>s3;
    map< char,long long > mp1;
    stack<long long>st;
    list<long long>li;
    int x[]={1,-1,1,-1,2,2,-2,-2};
    int y[]={2,2,-2,-2,1,-1,1,-1};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    map< long long,long long > mp;
    map< long long,long long>::iterator it;
    vector<pair<long long,long long> >v3;
    vector<pair<long long,long long> >v4;
    cin>>n;
    vector<long long>v(2*n);
    for(int i=0; i<2*n; i++)
        cin>>v[i];
    sort(v.begin(),v.end());
    for(int i=0,j=n; i<n; i++,j++)
    {
        if(v[i]<v[j])
            co++;
    }
    if(n%2==0)
        a=n/2;
    else a=(n/2)+1;
    if(co>=a) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
vector<long long>vprime;
void SieveOfEratosthenes(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (int p=2; p*p<=n; p
    ++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
          vprime.push_back(p);
}
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000,mi1=100000000000,mi2=100,mi3=1000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0;
    long long arr[100001],arr1[100001]={0};
    long long a1,a2,b1,b2,c1,c2,a3,a4,b3,b4,b5,b6,m1,m2,k1,l1,m3,m4,d1,d2;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    //vector<long long>v;

    vector<string>vs;
    vector<string>vs1;
    //vector<pair<long long,pair<long long, long long> > >v;
    set<long long>s;
    set<long long>s1;
    set<long long>s2;
    set<long long>s3;
    map< char,long long > mp1;
    stack<long long>st;
    list<long long>li;
    int x[]={1,-1,1,-1,2,2,-2,-2};
    int y[]={2,2,-2,-2,1,-1,1,-1};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    map< long long,long long > mp;
    map< long long,long long>::iterator it;
    vector<pair<long long,long long> >v3;
    vector<pair<long long,long long> >v4;
    cin>>n;
    vector<long long>v(2*n);
    for(int i=0; i<2*n; i++)
        cin>>v[i];
    sort(v.begin(),v.end());
    for(int i=0; i<n; i++)
    {
        sum+=v[i];
    }
    for(int i=n; i<2*n; i++)
        sum1+=v[i];
    if(sum1>sum)
        cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
vector<long long>vprime;
void SieveOfEratosthenes(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (int p=2; p*p<=n; p
    ++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
          vprime.push_back(p);
}
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000,mi1=100000000000,mi2=100,mi3=1000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0;
    long long arr[100001],arr1[100001]={0};
    long long a1,a2,b1,b2,c1,c2,a3,a4,b3,b4,b5,b6,m1,m2,k1,l1,m3,m4,d1,d2;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    //vector<long long>v;

    vector<string>vs;
    vector<string>vs1;
    //vector<pair<long long,pair<long long, long long> > >v;
    set<long long>s;
    set<long long>s1;
    set<long long>s2;
    set<long long>s3;
    map< char,long long > mp1;
    stack<long long>st;
    list<long long>li;
    int x[]={1,-1,1,-1,2,2,-2,-2};
    int y[]={2,2,-2,-2,1,-1,1,-1};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    map< long long,long long > mp;
    map< long long,long long>::iterator it;
    vector<pair<long long,long long> >v3;
    vector<pair<long long,long long> >v4;
    cin>>n;
    vector<long long>v(2*n);
    for(int i=0; i<2*n; i++)
        cin>>v[i];
    sort(v.begin(),v.end());
    for(int i=0,j=n; i<n; i++,j++)
    {
        //cout<<v[i]<<" "<<v[j]<<endl;
        if(v[i]<v[j])
            co++;
        if(v[i]==v[j])
            co1++;
    }
    if((co+co1)==n && co!=0)
        cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
vector<long long>vprime;
void SieveOfEratosthenes(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (int p=2; p*p<=n; p
    ++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
          vprime.push_back(p);
}
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000,mi1=100000000000,mi2=100,mi3=1000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0;
    long long arr[100001],arr1[100001]={0};
    long long a1,a2,b1,b2,c1,c2,a3,a4,b3,b4,b5,b6,m1,m2,k1,l1,m3,m4,d1,d2;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    //vector<long long>v;

    vector<string>vs;
    vector<string>vs1;
    //vector<pair<long long,pair<long long, long long> > >v;
    set<long long>s;
    set<long long>s1;
    set<long long>s2;
    set<long long>s3;
    map< char,long long > mp1;
    stack<long long>st;
    list<long long>li;
    int x[]={1,-1,1,-1,2,2,-2,-2};
    int y[]={2,2,-2,-2,1,-1,1,-1};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    map< long long,long long > mp;
    map< long long,long long>::iterator it;
    vector<pair<long long,long long> >v3;
    vector<pair<long long,long long> >v4;
    cin>>n;
    vector<long long>v(2*n);
    for(int i=0; i<2*n; i++)
        cin>>v[i];
    sort(v.begin(),v.end());
    for(int i=0,j=n; i<n; i++,j++)
    {
        cout<<v[i]<<" "<<v[j]<<endl;
        if(v[i]<v[j])
            co++;
    }
    if(n%2==0)
        a=(n/2)+1;
    else a=(n/2)+1;
    if(co>=a) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
vector<long long>vprime;
void SieveOfEratosthenes(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (int p=2; p*p<=n; p
    ++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
          vprime.push_back(p);
}
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000,mi1=100000000000,mi2=100,mi3=1000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0;
    long long arr[100001],arr1[100001]={0};
    long long a1,a2,b1,b2,c1,c2,a3,a4,b3,b4,b5,b6,m1,m2,k1,l1,m3,m4,d1,d2;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    //vector<long long>v;

    vector<string>vs;
    vector<string>vs1;
    //vector<pair<long long,pair<long long, long long> > >v;
    set<long long>s;
    set<long long>s1;
    set<long long>s2;
    set<long long>s3;
    map< char,long long > mp1;
    stack<long long>st;
    list<long long>li;
    int x[]={1,-1,1,-1,2,2,-2,-2};
    int y[]={2,2,-2,-2,1,-1,1,-1};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    map< long long,long long > mp;
    map< long long,long long>::iterator it;
    vector<pair<long long,long long> >v3;
    vector<pair<long long,long long> >v4;
    cin>>n;
    vector<long long>v(2*n);
    for(int i=0; i<2*n; i++)
        cin>>v[i];
    sort(v.begin(),v.end());
    for(int i=0,j=n; i<n; i++,j++)
    {
        //cout<<v[i]<<" "<<v[j]<<endl;
        if(v[i]<=v[j])
            co++;
    }
    if(co==n)
        cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
vector<long long>vprime;
void SieveOfEratosthenes(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (int p=2; p*p<=n; p
    ++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
          vprime.push_back(p);
}
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000,mi1=100000000000,mi2=100,mi3=1000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0;
    long long arr[100001],arr1[100001]={0};
    long long a1,a2,b1,b2,c1,c2,a3,a4,b3,b4,b5,b6,m1,m2,k1,l1,m3,m4,d1,d2;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    //vector<long long>v;

    vector<string>vs;
    vector<string>vs1;
    //vector<pair<long long,pair<long long, long long> > >v;
    set<long long>s;
    set<long long>s1;
    set<long long>s2;
    set<long long>s3;
    map< char,long long > mp1;
    stack<long long>st;
    list<long long>li;
    int x[]={1,-1,1,-1,2,2,-2,-2};
    int y[]={2,2,-2,-2,1,-1,1,-1};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    map< long long,long long > mp;
    map< long long,long long>::iterator it;
    vector<pair<long long,long long> >v3;
    vector<pair<long long,long long> >v4;
    cin>>n;
    vector<long long>v(2*n);
    for(int i=0; i<2*n; i++)
        cin>>v[i];
    sort(v.begin(),v.end());
    for(int i=0,j=n; i<n; i++,j++)
    {
        //cout<<v[i]<<" "<<v[j]<<endl;
        if(v[i]<v[j])
            co++;
    }
    if(n%2==0)
        a=(n/2)+1;
    else a=(n/2)+1;
    if(co>=a) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

void solve()
{
    int n;
    cin>>n;

    vector<int>a;

    for(int i=0;i<2*n;i++)
    {
      cin>>a[i];
    }

    sort(a.begin(),a.end());

    if(a[n]>a[n-1]) // a[n] = first team
    cout<<"YES";
    else
    cout<<"NO";
}

int main()
{

  #ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
    int t;
    //cin>>t;
    t=1;
    while(t)
    {
      solve();
      t--;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

void solve()
{
    int n;
    cin>>n;

    vector<int>a(2*n);

    for(int i=0;i<2*n;i++)
    {
      cin>>a[i];
    }

    sort(a.begin(),a.end());

    if(a[n]>a[n-1]) // a[n] = first team
    cout<<"YES";
    else
    cout<<"NO";
}

int main()
{

  #ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
    int t;
    //cin>>t;
    t=1;
    while(t)
    {
      solve();
      t--;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

void solve()
{
    int n;
    cin>>n;

    vector<int>a(n);

    for(int i=0;i<2*n;i++)
    {
      cin>>a[i];
    }

    sort(a.begin(),a.end());

    if(a[n]>a[n-1]) // a[n] = first team
    cout<<"YES";
    else
    cout<<"NO";
}

int main()
{

  #ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
    int t;
    //cin>>t;
    t=1;
    while(t)
    {
      solve();
      t--;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int N = 1000006;
const ll mod = 1e9 + 7;
const ll inf = 1e9;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cerr.tie(nullptr);

	int n;
	cin >> n;
	int a[2 * n];
	for (int i = 0; i < 2*n; i++) cin >> a[i];
	sort (a, a + 2*n);
	if (a[n-1] == a[n]) cout << "NO\n"; else cout << "YES\n";
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int N = 1000006;
const ll mod = 1e9 + 7;
const ll inf = 1e9;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cerr.tie(nullptr);

	int n;
	cin >> n;
	int a[2 * n];
	for (int i = 0; i < 2*n; i++) cin >> a[i];
	sort (a, a + 2*n);
	if (a[0] == a[n]) cout << "NO\n"; else cout << "YES\n";
}


/*
* Author : Omkar Deshmukh
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define endl '\n'
#define all(v) v.begin(), v.end()
#define intvect vector<int>
#define pii pair<int, int>
#define mii map<int, int>
#define fo(i, n) for (int i = 0; i < n; i++)
#define Fo(i, k, n) for (int i = k; i < n; i++)
#define boolv vector<bool>
#define ld long double
#define ub upper_bound
#define lb lower_bound
#define deb(x) cout << #x << " " << x << endl;
#define pb push_back
// calculate number of digits in an number
#define n(x) (int)floor(log10(x)) + 1
#define sz(a) (int)a.size()
#define pob pop_back
#define F first
#define S second
#define ull unsigned long long
#define mkp make_pair
// ^ can be used instead of !=
// (x << a) results in multiply x to pow(2,a)
// (x >> a) results in multiply x to 1/(pow(2,a))
const ll mod = 1e9 + 7;
const ll N = 1010;

template <typename... T>
void read(T &... args)
{
    ((cin >> args), ...);
}

template <typename... T>
void write(T &&... args) //rvalue references
{
    ((cout << args), ...);
}

void vjudge()
{
#ifndef ONLINE_JUDGE
    if (fopen("input.txt", "r"))
    {
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    }
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

bool p2(int x)
{
    return x && (!(x & (x - 1)));
}
void solve()
{
    int n;
    read(n);
    n *= 2;
    intvect a(n);
    fo(i, n) read(a[i]);
    sort(all(a));
    if (!(ub(all(a), a[n - 1]) - lb(all(a), a[n - 1])) & 1)
        cout << "NO";
    else
        cout << "YES";
}

int32_t main()
{
    vjudge();
    int t = 1;
    // cin >> t;
    while (t--)
        solve();
}


/*
* Author : Omkar Deshmukh
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define endl '\n'
#define all(v) v.begin(), v.end()
#define intvect vector<int>
#define pii pair<int, int>
#define mii map<int, int>
#define fo(i, n) for (int i = 0; i < n; i++)
#define Fo(i, k, n) for (int i = k; i < n; i++)
#define boolv vector<bool>
#define ld long double
#define ub upper_bound
#define lb lower_bound
#define deb(x) cout << #x << " " << x << endl;
#define pb push_back
// calculate number of digits in an number
#define n(x) (int)floor(log10(x)) + 1
#define sz(a) (int)a.size()
#define pob pop_back
#define F first
#define S second
#define ull unsigned long long
#define mkp make_pair
// ^ can be used instead of !=
// (x << a) results in multiply x to pow(2,a)
// (x >> a) results in multiply x to 1/(pow(2,a))
const ll mod = 1e9 + 7;
const ll N = 1010;

template <typename... T>
void read(T &... args)
{
    ((cin >> args), ...);
}

template <typename... T>
void write(T &&... args) //rvalue references
{
    ((cout << args), ...);
}

void vjudge()
{
#ifndef ONLINE_JUDGE
    if (fopen("input.txt", "r"))
    {
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    }
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

bool p2(int x)
{
    return x && (!(x & (x - 1)));
}
void solve()
{
    int n;
    read(n);
    n *= 2;
    intvect a(n);
    fo(i, n) read(a[i]);
    sort(all(a));
    if ((ub(all(a), a[n - 1]) - lb(all(a), a[n - 1])) > 1)
        cout << "NO";
    else
        cout << "YES";
}

int32_t main()
{
    vjudge();
    int t = 1;
    // cin >> t;
    while (t--)
        solve();
}


/*
* Author : Omkar Deshmukh
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define endl '\n'
#define all(v) v.begin(), v.end()
#define intvect vector<int>
#define pii pair<int, int>
#define mii map<int, int>
#define fo(i, n) for (int i = 0; i < n; i++)
#define Fo(i, k, n) for (int i = k; i < n; i++)
#define boolv vector<bool>
#define ld long double
#define ub upper_bound
#define lb lower_bound
#define deb(x) cout << #x << " " << x << endl;
#define pb push_back
// calculate number of digits in an number
#define n(x) (int)floor(log10(x)) + 1
#define sz(a) (int)a.size()
#define pob pop_back
#define F first
#define S second
#define ull unsigned long long
#define mkp make_pair
// ^ can be used instead of !=
// (x << a) results in multiply x to pow(2,a)
// (x >> a) results in multiply x to 1/(pow(2,a))
const ll mod = 1e9 + 7;
const ll N = 1010;

template <typename... T>
void read(T &... args)
{
    ((cin >> args), ...);
}

template <typename... T>
void write(T &&... args) //rvalue references
{
    ((cout << args), ...);
}

void vjudge()
{
#ifndef ONLINE_JUDGE
    if (fopen("input.txt", "r"))
    {
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    }
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

bool p2(int x)
{
    return x && (!(x & (x - 1)));
}
void solve()
{
    int n;
    read(n);
    n *= 2;
    intvect a(n);
    fo(i, n) read(a[i]);
    sort(all(a));
    int tp = (ub(all(a), a[n - 1]) - lb(all(a), a[n - 1]));
    if (tp % 2 == 0)
        cout << "NO";
    else
        cout << "YES";
}

int32_t main()
{
    vjudge();
    int t = 1;
    // cin >> t;
    while (t--)
        solve();
}


/*
* Author : Omkar Deshmukh
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define endl '\n'
#define all(v) v.begin(), v.end()
#define intvect vector<int>
#define pii pair<int, int>
#define mii map<int, int>
#define fo(i, n) for (int i = 0; i < n; i++)
#define Fo(i, k, n) for (int i = k; i < n; i++)
#define boolv vector<bool>
#define ld long double
#define ub upper_bound
#define lb lower_bound
#define deb(x) cout << #x << " " << x << endl;
#define pb push_back
// calculate number of digits in an number
#define n(x) (int)floor(log10(x)) + 1
#define sz(a) (int)a.size()
#define pob pop_back
#define F first
#define S second
#define ull unsigned long long
#define mkp make_pair
// ^ can be used instead of !=
// (x << a) results in multiply x to pow(2,a)
// (x >> a) results in multiply x to 1/(pow(2,a))
const ll mod = 1e9 + 7;
const ll N = 1010;

template <typename... T>
void read(T &... args)
{
    ((cin >> args), ...);
}

template <typename... T>
void write(T &&... args) //rvalue references
{
    ((cout << args), ...);
}

void vjudge()
{
#ifndef ONLINE_JUDGE
    if (fopen("input.txt", "r"))
    {
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    }
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

bool p2(int x)
{
    return x && (!(x & (x - 1)));
}
void solve()
{
    int n;
    read(n);
    n *= 2;
    intvect a(n);
    fo(i, n) read(a[i]);
    sort(all(a));
    n /= 2;
    if (a[n - 1] != a[n])
        cout << "YES\n";
    else
        cout << "NO\n";
}

int32_t main()
{
    vjudge();
    int t = 1;
    // cin >> t;
    while (t--)
        solve();
}


//BISMILLAHIR-RAH-MANIR-RAHIM.
//ABU AYUB MD AHMADUL(CEO-PEREGRINE SPHERE).
//FORMER CEO-SPACEH(2019).
//DEPT.OF CSE,SUST//2018-19.
//------------------------------------------\\
//PRE-CODE========>
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#include<vector>
#include<math.h>
#include<numeric>
#include<stack>
#include<queue>
#include<string>
#include<algorithm>
#include<map>
#define mp make_pair
#define ins insert
#define lli long long int
#define ll long long
#define pb push_back
#define loop1(i,l,n) for(i=l;i<=n;i++)
#define loop0(i,l,n) for(i=l;i<n;i++)
#define inf (1<<28)
#define pi 3.1415926536
const int MAX=1e6+9;
set<int>ist;
map<string,int>msi;
map<string,string>mss;
map<int,string>mis;
map<int,int>mii;
pair<int,int>pii;
vector<int>v;
vector<pair<int,int> >vv;
int cc[]= {1,-1,0,0};
int rr[]= {0,0,1,-1};
//BIPARTITE GRAPH FUCTION========>
/*
int cnt[2];
int vertices[MAX];
void Bipartite(int node,int pnode,int color)
{
    cnt[color]++;
    for (int i=0;i<vertices[node].size();i++)
    {
        if (vertices[node][i]!=pnode)
        {
            Bipartite(vertices[node][i],node,!color);
        }

    }
}
*/
//REAL TIME BINARY SERACH FUNCTION========>
/*
int Bsearch(int left,int right,int query,int n)
{
    int mid=left+(right-left)/2;
    if(query<mid)
    {
        return Bsearch(left,mid-1,query,n);
    }
    else if(query>mid)
    {
        return Bsearch(mid+1,right,query,n-1);
    }
    else
    {
        return n;
    }
}
*/
//DECIMAL TO BINARY DECODING========>
/*
ll D2B(ll dec)
{
    ll digit[32]={};
    ll i = 0;
    while (dec > 0)
    {
        [i] = n % 2;
        n = n / 2;
        i++;
    }

}
*/
//BINARY TO DECIMAL DECODING========>
/*
ll b2d(ll bin)
{
    ll digit,sum=0,h=0;
    while(bin!=0)
    {
        digit=bin%10;
        sum+=digit*pow(2,h++);
        bin/=10;
    }
    return sum;
}
*/
//DFS FUNCTION=========>
/*
int visited[MAX];
vector<int>adj[MAX];
int weight[MAX];
void dfs(int v)
{
    visited[v] = 1;
    for (auto j: adj[v])
    {
        if (!visited[j])
        {
            dfs(j);
        }
    }
}
*/
//------------------------------------------\\
//LAUNCHING SHARK-20========>
void BACKSLASH()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t;
    int n;
    cin>>n;
    int m=2*n;
    int ahm[n];
    for(int i=0;i<m;i++)
    {
        cin>>ahm[i];
    }
    sort(ahm,ahm+n);
    if(ahm[n-1]==ahm[n])
    {
        cout<<"NO"<<endl;
    }
    else
    {
        cout<<"YES"<<endl;
    }

}
//MAIN FUNCTION========>
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    BACKSLASH();

    return 0;
}
//------------------------------------------\\
//ABOUT THE SERIES========>
//THE BUTTERFLY SERIES-(MAY-2020).
//SPONSERED BY QUANTUM SPACE(CEO-NAIMUL ISLAM).
//CONTROLLER=>SAFIA BEGUM(CEO-BACKS/ASH).
//ADVISOR=>NASRULLAH SAMI(CEO-FALCON AXIS).
//CO-CHIEF ADVISOR=>G.M NAYEEM(CEO-TECH FRIGATE).
//PRESIDENT=>SAMIA PREITY(CEO-FASTEX AND SPAIT).


//BISMILLAHIR-RAH-MANIR-RAHIM.
//ABU AYUB MD AHMADUL(CEO-PEREGRINE SPHERE).
//FORMER CEO-SPACEH(2019).
//DEPT.OF CSE,SUST//2018-19.
//------------------------------------------\\
//PRE-CODE========>
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#include<vector>
#include<math.h>
#include<numeric>
#include<stack>
#include<queue>
#include<string>
#include<algorithm>
#include<map>
#define mp make_pair
#define ins insert
#define lli long long int
#define ll long long
#define pb push_back
#define loop1(i,l,n) for(i=l;i<=n;i++)
#define loop0(i,l,n) for(i=l;i<n;i++)
#define inf (1<<28)
#define pi 3.1415926536
const int MAX=1e6+9;
set<int>ist;
map<string,int>msi;
map<string,string>mss;
map<int,string>mis;
map<int,int>mii;
pair<int,int>pii;
vector<int>v;
vector<pair<int,int> >vv;
int cc[]= {1,-1,0,0};
int rr[]= {0,0,1,-1};
//BIPARTITE GRAPH FUCTION========>
/*
int cnt[2];
int vertices[MAX];
void Bipartite(int node,int pnode,int color)
{
    cnt[color]++;
    for (int i=0;i<vertices[node].size();i++)
    {
        if (vertices[node][i]!=pnode)
        {
            Bipartite(vertices[node][i],node,!color);
        }

    }
}
*/
//REAL TIME BINARY SERACH FUNCTION========>
/*
int Bsearch(int left,int right,int query,int n)
{
    int mid=left+(right-left)/2;
    if(query<mid)
    {
        return Bsearch(left,mid-1,query,n);
    }
    else if(query>mid)
    {
        return Bsearch(mid+1,right,query,n-1);
    }
    else
    {
        return n;
    }
}
*/
//DECIMAL TO BINARY DECODING========>
/*
ll D2B(ll dec)
{
    ll digit[32]={};
    ll i = 0;
    while (dec > 0)
    {
        [i] = n % 2;
        n = n / 2;
        i++;
    }

}
*/
//BINARY TO DECIMAL DECODING========>
/*
ll b2d(ll bin)
{
    ll digit,sum=0,h=0;
    while(bin!=0)
    {
        digit=bin%10;
        sum+=digit*pow(2,h++);
        bin/=10;
    }
    return sum;
}
*/
//DFS FUNCTION=========>
/*
int visited[MAX];
vector<int>adj[MAX];
int weight[MAX];
void dfs(int v)
{
    visited[v] = 1;
    for (auto j: adj[v])
    {
        if (!visited[j])
        {
            dfs(j);
        }
    }
}
*/
//------------------------------------------\\
//LAUNCHING SHARK-20========>
void BACKSLASH()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t;
    int n;
    cin>>n;
    n=2*n;
    int ahm[n];
    for(int i=0;i<n;i++)
    {
        cin>>ahm[i];
    }
    sort(ahm,ahm+n);
    if(ahm[n-1]==ahm[n])
    {
        cout<<"NO"<<endl;
    }
    else
    {
        cout<<"YES"<<endl;
    }

}
//MAIN FUNCTION========>
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    BACKSLASH();

    return 0;
}
//------------------------------------------\\
//ABOUT THE SERIES========>
//THE BUTTERFLY SERIES-(MAY-2020).
//SPONSERED BY QUANTUM SPACE(CEO-NAIMUL ISLAM).
//CONTROLLER=>SAFIA BEGUM(CEO-BACKS/ASH).
//ADVISOR=>NASRULLAH SAMI(CEO-FALCON AXIS).
//CO-CHIEF ADVISOR=>G.M NAYEEM(CEO-TECH FRIGATE).
//PRESIDENT=>SAMIA PREITY(CEO-FASTEX AND SPAIT).


//BISMILLAHIR-RAH-MANIR-RAHIM.
//ABU AYUB MD AHMADUL(CEO-PEREGRINE SPHERE).
//FORMER CEO-SPACEH(2019).
//DEPT.OF CSE,SUST//2018-19.
//------------------------------------------\\
//PRE-CODE========>
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#include<vector>
#include<math.h>
#include<numeric>
#include<stack>
#include<queue>
#include<string>
#include<algorithm>
#include<map>
#define mp make_pair
#define ins insert
#define lli long long int
#define ll long long
#define pb push_back
#define loop1(i,l,n) for(i=l;i<=n;i++)
#define loop0(i,l,n) for(i=l;i<n;i++)
#define inf (1<<28)
#define pi 3.1415926536
const int MAX=1e6+9;
set<int>ist;
map<string,int>msi;
map<string,string>mss;
map<int,string>mis;
map<int,int>mii;
pair<int,int>pii;
vector<int>v;
vector<pair<int,int> >vv;
int cc[]= {1,-1,0,0};
int rr[]= {0,0,1,-1};
//BIPARTITE GRAPH FUCTION========>
/*
int cnt[2];
int vertices[MAX];
void Bipartite(int node,int pnode,int color)
{
    cnt[color]++;
    for (int i=0;i<vertices[node].size();i++)
    {
        if (vertices[node][i]!=pnode)
        {
            Bipartite(vertices[node][i],node,!color);
        }

    }
}
*/
//REAL TIME BINARY SERACH FUNCTION========>
/*
int Bsearch(int left,int right,int query,int n)
{
    int mid=left+(right-left)/2;
    if(query<mid)
    {
        return Bsearch(left,mid-1,query,n);
    }
    else if(query>mid)
    {
        return Bsearch(mid+1,right,query,n-1);
    }
    else
    {
        return n;
    }
}
*/
//DECIMAL TO BINARY DECODING========>
/*
ll D2B(ll dec)
{
    ll digit[32]={};
    ll i = 0;
    while (dec > 0)
    {
        [i] = n % 2;
        n = n / 2;
        i++;
    }

}
*/
//BINARY TO DECIMAL DECODING========>
/*
ll b2d(ll bin)
{
    ll digit,sum=0,h=0;
    while(bin!=0)
    {
        digit=bin%10;
        sum+=digit*pow(2,h++);
        bin/=10;
    }
    return sum;
}
*/
//DFS FUNCTION=========>
/*
int visited[MAX];
vector<int>adj[MAX];
int weight[MAX];
void dfs(int v)
{
    visited[v] = 1;
    for (auto j: adj[v])
    {
        if (!visited[j])
        {
            dfs(j);
        }
    }
}
*/
//------------------------------------------\\
//LAUNCHING SHARK-20========>
void BACKSLASH()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t;
    int n;
    cin>>n;
    int m=2*n;
    int ahm[n];
    for(int i=0;i<m;i++)
    {
        cin>>ahm[i];
    }
    sort(ahm,ahm+m);
    if(ahm[n-1]==ahm[n])
    {
        cout<<"NO"<<endl;
    }
    else
    {
        cout<<"YES"<<endl;
    }

}
//MAIN FUNCTION========>
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    BACKSLASH();

    return 0;
}
//------------------------------------------\\
//ABOUT THE SERIES========>
//THE BUTTERFLY SERIES-(MAY-2020).
//SPONSERED BY QUANTUM SPACE(CEO-NAIMUL ISLAM).
//CONTROLLER=>SAFIA BEGUM(CEO-BACKS/ASH).
//ADVISOR=>NASRULLAH SAMI(CEO-FALCON AXIS).
//CO-CHIEF ADVISOR=>G.M NAYEEM(CEO-TECH FRIGATE).
//PRESIDENT=>SAMIA PREITY(CEO-FASTEX AND SPAIT).


//BISMILLAHIR-RAH-MANIR-RAHIM.
//ABU AYUB MD AHMADUL(CEO-PEREGRINE SPHERE).
//FORMER CEO-SPACEH(2019).
//DEPT.OF CSE,SUST//2018-19.
//------------------------------------------\\
//PRE-CODE========>
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#include<vector>
#include<math.h>
#include<numeric>
#include<stack>
#include<queue>
#include<string>
#include<algorithm>
#include<map>
#define mp make_pair
#define ins insert
#define lli long long int
#define ll long long
#define pb push_back
#define loop1(i,l,n) for(i=l;i<=n;i++)
#define loop0(i,l,n) for(i=l;i<n;i++)
#define inf (1<<28)
#define pi 3.1415926536
const int MAX=1e6+9;
set<int>ist;
map<string,int>msi;
map<string,string>mss;
map<int,string>mis;
map<int,int>mii;
pair<int,int>pii;
vector<int>v;
vector<pair<int,int> >vv;
int cc[]= {1,-1,0,0};
int rr[]= {0,0,1,-1};
//BIPARTITE GRAPH FUCTION========>
/*
int cnt[2];
int vertices[MAX];
void Bipartite(int node,int pnode,int color)
{
    cnt[color]++;
    for (int i=0;i<vertices[node].size();i++)
    {
        if (vertices[node][i]!=pnode)
        {
            Bipartite(vertices[node][i],node,!color);
        }

    }
}
*/
//REAL TIME BINARY SERACH FUNCTION========>
/*
int Bsearch(int left,int right,int query,int n)
{
    int mid=left+(right-left)/2;
    if(query<mid)
    {
        return Bsearch(left,mid-1,query,n);
    }
    else if(query>mid)
    {
        return Bsearch(mid+1,right,query,n-1);
    }
    else
    {
        return n;
    }
}
*/
//DECIMAL TO BINARY DECODING========>
/*
ll D2B(ll dec)
{
    ll digit[32]={};
    ll i = 0;
    while (dec > 0)
    {
        [i] = n % 2;
        n = n / 2;
        i++;
    }

}
*/
//BINARY TO DECIMAL DECODING========>
/*
ll b2d(ll bin)
{
    ll digit,sum=0,h=0;
    while(bin!=0)
    {
        digit=bin%10;
        sum+=digit*pow(2,h++);
        bin/=10;
    }
    return sum;
}
*/
//DFS FUNCTION=========>
/*
int visited[MAX];
vector<int>adj[MAX];
int weight[MAX];
void dfs(int v)
{
    visited[v] = 1;
    for (auto j: adj[v])
    {
        if (!visited[j])
        {
            dfs(j);
        }
    }
}
*/
//------------------------------------------\\
//LAUNCHING SHARK-20========>
void BACKSLASH()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t;
    int n;
    cin>>n;
    int m=2*n;
    int ahm[m];
    for(int i=0;i<m;i++)
    {
        cin>>ahm[i];
    }
    sort(ahm,ahm+m);
    if(ahm[n-1]==ahm[n])
    {
        cout<<"NO"<<endl;
    }
    else
    {
        cout<<"YES"<<endl;
    }

}
//MAIN FUNCTION========>
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    BACKSLASH();

    return 0;
}
//------------------------------------------\\
//ABOUT THE SERIES========>
//THE BUTTERFLY SERIES-(MAY-2020).
//SPONSERED BY QUANTUM SPACE(CEO-NAIMUL ISLAM).
//CONTROLLER=>SAFIA BEGUM(CEO-BACKS/ASH).
//ADVISOR=>NASRULLAH SAMI(CEO-FALCON AXIS).
//CO-CHIEF ADVISOR=>G.M NAYEEM(CEO-TECH FRIGATE).
//PRESIDENT=>SAMIA PREITY(CEO-FASTEX AND SPAIT).


#include<iostream>
#include<cstdlib>
using namespace std;
main()
{
     int n,i,j,k,ar[1000],t;
     cin>>n;
     int l=2*n;
     for(i=0;i<2*n;i++)
     {
          cin>>ar[i];

     }
     for(j=0;j<l-1;j++)
     {
          for(k=0;k<l-j-1;k++)
          {
               if(ar[k]>ar[k+1])
               {
               t=ar[k];
               ar[k]=ar[k+1];
               ar[k+1]=t;
               }
          }
     }
     int f;
     for(i=0;i<l;i++)
     {
          if(ar[i]!=-1)
          {
          for(j=i+1;j<l;j++)
         {

              if(ar[j]>ar[i]&&ar[j]!=-1)
              {
                   f=f+2;
                   ar[j]=-1;
                   ar[i]=-1;
                   break;
              }

         }
          }

     }
     if(f==l)
     cout<<"YES";
     else cout<<"NO";
     return 0;
}


#include<iostream>
#include<cstdlib>
using namespace std;
main()
{
     int n,i,j,k,ar[1000],t;
     cin>>n;
     int l=2*n;
     for(i=0;i<2*n;i++)
     {
          cin>>ar[i];

     }
     for(j=0;j<l-1;j++)
     {
          for(k=0;k<l-j-1;k++)
          {
               if(ar[k]>ar[k+1])
               {
               t=ar[k];
               ar[k]=ar[k+1];
               ar[k+1]=t;
               }
          }
     }
     int f;
     for(i=0;i<l;i++)
     {
          f=0;
          for(j=i+1;j<l;j++)
         {

              if(ar[j]>ar[i]&&ar[i]!=-1&&ar[j]!=-1)
              {
                   f=1;
                   ar[j]=-1;
                   ar[i]=-1;
                   break;
              }

         }
         if(f==0)
         {
              cout<<"NO";
              return 0;
         }
     }
     cout<<"YES";
     return 0;
}


#include<iostream>
#include<cstdlib>
using namespace std;
main()
{
     int n,i,j,k,ar[1000],t;
     cin>>n;
     int l=2*n;
     for(i=0;i<2*n;i++)
     {
          cin>>ar[i];

     }
     for(j=0;j<l-1;j++)
     {
          for(k=0;k<l-j-1;k++)
          {
               if(ar[k]>ar[k+1])
               {
               t=ar[k];
               ar[k]=ar[k+1];
               ar[k+1]=t;
               }
          }
     }
     if(ar[n]==ar[n-1])
     cout<<"NO";
     else cout<<"YES";
     return 0;
}


#include<iostream>
#include<cstdlib>
using namespace std;
main()
{
     int n,i,j,k,ar[1000],t;
     cin>>n;
     int l=2*n;
     for(i=0;i<2*n;i++)
     {
          cin>>ar[i];

     }
     for(j=0;j<l-1;j++)
     {
          for(k=0;k<l-j-1;k++)
          {
               if(ar[k]>ar[k+1])
               {
               t=ar[k];
               ar[k]=ar[k+1];
               ar[k+1]=t;
               }
          }
     }
     int f;
     for(i=0;i<l;i++)
     {
          if(ar[i]!=-1)
          {
          for(j=i+1;j<l;j++)
         {

              if(ar[j]>ar[i]&&ar[j]!=-1)
              {
                   f=f+2;
                   ar[j]=-1;
                   ar[i]=-1;
                   break;
              }

         }
          }

     }
     if(f==l)
     cout<<"YES";
     else cout<<"NO"
     return 0;
}


#include<iostream>
#include<cstdlib>
using namespace std;
main()
{
     int n,i,j,k,ar[1000],t;
     cin>>n;
     int l=2*n;
     for(i=0;i<2*n;i++)
     {
          cin>>ar[i];

     }
     for(j=0;j<l-1;j++)
     {
          for(k=0;k<l-j-1;k++)
          {
               if(ar[k]>ar[k+1])
               {
               t=ar[k];
               ar[k]=ar[k+1];
               ar[k+1]=t;
               }
          }
     }
     int f;
     for(i=0;i<l;i++)
     {
          if(ar[i]<ar[i+1]&&i+1!=l)
          {
               f=1;
          }
          else if(ar[i]==ar[i+1])
           {
                cout<<"NO";
                return 0;
           }
     }
     cout<<"YES";
     return 0;
}


#include<bits/stdc++.h>
using namespace std;
void fast()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int main()
{
       fast();
       int n,i,x,sum1=0,sum2=0,p;
       cin>>n;
       n=2*n;
       set<int>a;
       for(i=0;i<n;i++)
           {
               cin>>x;
               a.insert(x);
           }
           x=0;
          for(const auto& it:a)
           {
               x++;
           }
        x= a.size();
        if(x==1)
        {
            cout<<"NO"<<endl;
        }
        else
        {
            cout<<"YES"<<endl;
        }
}


#include<bits/stdc++.h>
using namespace std;
void fast()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int main()
{
       fast();
       int n,i,x,sum1=0,sum2=0,p;
       cin>>n;
       n=2*n;
       set<int>a;
       for(i=0;i<n;i++)
           {
               cin>>x;
               a.insert(x);
           }
           x=0;
          for(const auto& it:a)
           {
               x++;
           }
        x= a.size();
        if(x%2==1)
        {
            cout<<"NO"<<endl;
        }
        else
        {
            cout<<"YES"<<endl;
        }
}


#include<bits/stdc++.h>
using namespace std;
void fast()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int main()
{
       fast();
       int n,i,j;
       cin>>n;
       n*=2;
       int a[n];
       for(i=0;i<n;i++)
           cin>>a[i];
        sort(a,a+n,greater<int>());
        for(i=0;i<n/2;i++)
        {
            for(j=n/2;j<n;j++)
            {
                    if(a[i]==a[j])
                    {
                        cout<<"NO"<<endl;
                        return 0;
                    }
            }
        }
        cout<<"YES"<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin >> n;
	int a[2*n];
	for(int i = 0; i < 2*n ; i++){
		cin >> a[i];
	}

	sort(a , a+2*n);

	int x = (n+1)/2;

	int i = 2*n-1 , j = n-1 , cnt = 1;
	while(j >= 0){
		if(a[i] <= a[j])
			cnt = 0;
		i--;
		j--;
	}

	if(cnt)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin >> n;
	int a[2*n];
	for(int i = 0; i < 2*n ; i++){
		cin >> a[i];
	}

	sort(a , a+2*n);

	int x = (n+1)/2;

	int i = 2*n-1 , j = n-1 , cnt = 0;
	while(j >= 0){
		if(a[i] > a[j])
			cnt++;
		i--;
		j--;
	}

	if(cnt >= x)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin >> n;
	int a[2*n];
	for(int i = 0; i < 2*n ; i++){
		cin >> a[i];
	}

	sort(a , a+2*n);

	if(a[n-1] < a[n])
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin >> n;
	int a[2*n];
	for(int i = 0; i < 2*n ; i++){
		cin >> a[i];
	}

	sort(a , a+2*n);

	int x = (n+1)/2;
	if(a[(2*n-1)-(x-1)] > a[(n-1) - (x-1)])
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}


#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast,no-stack-protector")
#include<bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define endl "\n"
#define LL long long int
#define vi vector<int>
#define vl vector<LL>
#define all(V) V.begin(),V.end()
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%I64d",&x)
#define pii pair<int,int>
#define pll pair<LL,LL>
#ifndef ONLINE_JUDGE
#define cout cerr
#endif
#define cmax(a,b) ((a) = (a) > (b) ? (a) : (b))
#define cmin(a,b) ((a) = (a) < (b) ? (a) : (b))
#define debug(x)  cerr << #x << " = " << x << endl
function<void(void)> ____ = [](){ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);};
template <typename T> vector<T>& operator << (vector<T> &__container, T x){ __container.push_back(x); return __container; }
template <typename T> ostream& operator << (ostream &out, vector<T> &__container){ for(T _ : __container) out << _ << ' '; return out; }
const int MAXN = 2e5+7;

void solve(){
    int n; sci(n);
    vi A(2*n); for(int &x : A) sci(x);
    sort(all(A));
    if(A[n]>A[n-1]) cout << "YES" << endl;
    else cout << "NO" << endl;
}
int main(){
    #ifndef ONLINE_JUDGE
    freopen("Local.in","r",stdin);
    freopen("ans.out","w",stdout);
    #endif
    solve();
    return 0;
}


#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast,no-stack-protector")
#include<bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define endl "\n"
#define LL long long int
#define vi vector<int>
#define vl vector<LL>
#define all(V) V.begin(),V.end()
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%I64d",&x)
#define pii pair<int,int>
#define pll pair<LL,LL>
#ifndef ONLINE_JUDGE
#define cout cerr
#endif
#define cmax(a,b) ((a) = (a) > (b) ? (a) : (b))
#define cmin(a,b) ((a) = (a) < (b) ? (a) : (b))
#define debug(x)  cerr << #x << " = " << x << endl
function<void(void)> ____ = [](){ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);};
template <typename T> vector<T>& operator << (vector<T> &__container, T x){ __container.push_back(x); return __container; }
template <typename T> ostream& operator << (ostream &out, vector<T> &__container){ for(T _ : __container) out << _ << ' '; return out; }
const int MAXN = 2e5+7;
int n;

void solve(){
    sci(n);;
    vector<pii> A(n);
    for(auto &p : A) sci(p.first), sci(p.second);
    sort(all(A));
    int a = 0, b = 0;
    for(auto p : A){
        if(p.first > a) a = p.second;
        else if(p.first > b) b = p.second;
        else{
            cout << "NO" << endl;
            return;
        }
    }
    cout << "YES" << endl;
}
int main(){
    #ifndef ONLINE_JUDGE
    freopen("Local.in","r",stdin);
    freopen("ans.out","w",stdout);
    #endif
    solve();
    return 0;
}


#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast,no-stack-protector")
#include<bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define endl "\n"
#define LL long long int
#define vi vector<int>
#define vl vector<LL>
#define all(V) V.begin(),V.end()
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%I64d",&x)
#define pii pair<int,int>
#define pll pair<LL,LL>
#ifndef ONLINE_JUDGE
#define cout cerr
#endif
#define cmax(a,b) ((a) = (a) > (b) ? (a) : (b))
#define cmin(a,b) ((a) = (a) < (b) ? (a) : (b))
#define debug(x)  cerr << #x << " = " << x << endl
function<void(void)> ____ = [](){ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);};
template <typename T> vector<T>& operator << (vector<T> &__container, T x){ __container.push_back(x); return __container; }
template <typename T> ostream& operator << (ostream &out, vector<T> &__container){ for(T _ : __container) out << _ << ' '; return out; }
const int MAXN = 2e5+7;

void solve(){
    int n; sci(n);
    vi A(2*n); for(int &x : A) sci(x);
    sort(all(A));
    if(A[n]>=A[n-1]) cout << "YES" << endl;
    else cout << "NO" << endl;
}
int main(){
    #ifndef ONLINE_JUDGE
    freopen("Local.in","r",stdin);
    freopen("ans.out","w",stdout);
    #endif
    solve();
    return 0;
}


#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast,no-stack-protector")
#include<bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define endl "\n"
#define LL long long int
#define vi vector<int>
#define vl vector<LL>
#define all(V) V.begin(),V.end()
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%I64d",&x)
#define pii pair<int,int>
#define pll pair<LL,LL>
#ifndef ONLINE_JUDGE
#define cout cerr
#endif
#define cmax(a,b) ((a) = (a) > (b) ? (a) : (b))
#define cmin(a,b) ((a) = (a) < (b) ? (a) : (b))
#define debug(x)  cerr << #x << " = " << x << endl
function<void(void)> ____ = [](){ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);};
template <typename T> vector<T>& operator << (vector<T> &__container, T x){ __container.push_back(x); return __container; }
template <typename T> ostream& operator << (ostream &out, vector<T> &__container){ for(T _ : __container) out << _ << ' '; return out; }
const int MAXN = 2e5+7;

void solve(){
    int n; sci(n);
    vi A(2*n); for(int &x : A) sci(x);
    sort(all(A));
    vi v1(n), v2(n);
    for(int i = 0; i < n; i++) v1[i] = A[i], v2[i] = A[i+n];
    for(int i = 0; i < n; i++) if(v2[i]<=v1[i]){
        cout << "NO" << endl;
        return;
    }
    cout << "YES" << endl;
}
int main(){
    #ifndef ONLINE_JUDGE
    freopen("Local.in","r",stdin);
    freopen("ans.out","w",stdout);
    #endif
    solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define radhey krishna
#define endl "\n"
const int N = 2e6;

int main(){
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif
       ios_base::sync_with_stdio(false);
       cin.tie(NULL);
   int n;
   cin>>n;
   int a[201];
   for (int i = 0; i < 2*n; ++i)
   {
   	  cin>>a[i];
   }
   sort(a, a+2*n);
   if(a[n] > a[n-1]){
   	cout<<"Yes"<<endl;
   }
   else{
   	cout<<-1<<endl;
   }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define radhey krishna
#define endl "\n"
const int N = 2e6;

int main(){
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif
       ios_base::sync_with_stdio(false);
       cin.tie(NULL);
   int n;
   cin>>n;
   int a[201];
   for (int i = 0; i < 2*n; ++i)
   {
   	  cin>>a[i];
   }
   sort(a, a+2*n);
   if(a[n] > a[n-1]){
   	cout<<"Yes"<<endl;
   }
   else{
   	cout<<"No"<<endl;
   }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define radhey krishna
#define endl "\n"
const int N = 2e6;
int a[N];

bool cmp(int a , int b){
	return a > b;
}

ll lcm(ll a ,ll b){
	ll large = max(a, b);
	ll small = min(a,b);
	for(ll i = large; ; i+= large){
		if(i % small == 0){
			return i;
		}
	}
}
bool isprime(ll n){
	for (ll i = 2; i*i <=n ; ++i)
	{
		if(n % i == 0){
			return false;
		}

	}
	return true;
}

int main(){
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif
       ios_base::sync_with_stdio(false);
       cin.tie(NULL);
       /*
string s , t;
cin>>s;
int v = s.size();
int n;
cin>>n;
string ans = " ";
for (int i = 0; i < n; ++i)
{
	cin>>t;
	string k(t.begin() , t.begin() + v);
	if(k == s && t < ans){
		ans  = t;
	}
	else if(k == s && ans == " "){
		ans = t;
	}
}
	if(ans == " "){
    cout<<s<<endl;
	}
	else{
		cout<<ans<<endl;
	}

}
*/

int t;
cin>>t;
while(t--){
	int n;
	cin>>n;
	vector<int>odd , even;
	for (int i = 1; i <= 2*n; ++i)
	{
		cin>>a[i];
		if(a[i] % 2){
			odd.push_back(i );
		}
		else{
			even.push_back(i);
		}
	}

    vector<pair<int ,int >>ans;

	for (int i = 0; i + 1 < odd.size(); i += 2)
	{
		ans.push_back({odd[i] , odd[i+1]});
	}
	for(int i = 0; i + 1 < even.size() ; i += 2){
		ans.push_back({even[i] , even[i+1]});
	}
	for(int i = 0 ;i< n-1 ;i++){
		cout<<ans[i].first<<" "<<ans[i].second<<endl;
	}
}
}


#include <bits/stdc++.h>

using namespace std;

const int MAXX = 2e2 + 10;
int n, a[MAXX];

int main() {
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n;
	for(int i = 0; i < 2 * n; i++)
		cin >> a[i];
	sort(a, a + 2 * n);
	if(a[n] == a[n - 1])
		return cout << "NO" << endl, 0;
	return cout << "YES" << endl, 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXX = 1e2 + 10;
int n, a[MAXX];

int main() {
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n;
	for(int i = 0; i < 2 * n; i++)
		cin >> a[i];
	sort(a, a + 2 * n);
	if(a[n] == a[n - 1])
		return cout << "NO" << endl, 0;
	return cout << "YES" << endl, 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXX = 1e2 + 10;
int n, a[MAXX];

int main() {
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n;
	for(int i = 0; i < 2 * n; i++)
		cin >> a[i];
	sort(a, a + n);
	if(a[n] == a[n - 1])
		return cout << "NO" << endl, 0;
	return cout << "YES" << endl, 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int n;cin>>n;int arr[2*n], sumB = 0, sumS = 0;
    for(int i = 0; i < 2*n; i++)
        cin>>arr[i];
    sort(arr, arr+2*n);
    for(int i = 0; i < n; i++)
    {
        sumS+=arr[i];
    }
    for(int i = n; i < 2*n; i++)
    {
        sumB+=arr[i];
    }
    if(sumB>sumS)
        cout<<"YES";
    else
        cout<<"NO";
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int n;cin>>n;int arr[2*n], sumB = 0, sumS = 0;
    for(int i = 0; i < 2*n; i++)
        cin>>arr[i];
    for(int i = 0; i < 2*n; i++)
    {
        if(arr[i] == arr[2*n-1-i])
        {
            cout<<"NO";
            return 0;
        }
    }
    cout<<"YES";
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int n;cin>>n;int arr[n], sumB = 0, sumS = 0;
    for(int i = 0; i < 2*n; i++)
        cin>>arr[i];
    sort(arr, arr+n);
    for(int i = 0; i < n; i++)
    {
        sumS+=arr[i];
    }
    for(int i = n; i < 2*n; i++)
    {
        sumB+=arr[i];
    }
    if(sumB>sumS)
        cout<<"YES";
    else
        cout<<"NO";
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int n;cin>>n;int arr[n], sumB = 0, sumS = 0;
    for(int i = 0; i < 2*n; i++)
        cin>>arr[i];
    sort(arr, arr+2*n);
    for(int i = 0; i < n; i++)
    {
        sumS+=arr[i];
    }
    for(int i = n; i < 2*n; i++)
    {
        sumB+=arr[i];
    }
    if(sumB>sumS)
        cout<<"YES";
    else
        cout<<"NO";
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int n;cin>>n;int arr[2*n], sumB = 0, sumS = 0;
    for(int i = 0; i < 2*n; i++)
        cin>>arr[i];
    sort(arr, arr+2*n);
    for(int i = 0; i < 2*n; i++)
    {
        i%2? sumB+=arr[i]:sumS+=arr[i];
    }
    if(sumB>sumS)
        cout<<"YES";
    else
        cout<<"NO";
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int n;cin>>n;int arr[2*n], sumB = 0, sumS = 0;
    for(int i = 0; i < 2*n; i++)
        cin>>arr[i];
    sort(arr, arr+2*n);
    if(arr[n] == arr[n-1])
        cout<<"NO";
    else
        cout<<"YES";
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int n;cin>>n;int arr[2*n], sumB = 0, sumS = 0;
    for(int i = 0; i < 2*n; i++)
        cin>>arr[i];
    sort(arr, arr+2*n);
    for(int i = 0; i < n; i++)
    {
        if(arr[i] == arr[2*n-1-i])
        {
            cout<<"NO";
            return 0;
        }
    }
    if(arr[n] == arr[n-1])
        cout<<"NO";
    else
        cout<<"YES";
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int n;cin>>n;int arr[2*n], sumB = 0, sumS = 0;
    for(int i = 0; i < 2*n; i++)
        cin>>arr[i];
    sort(arr, arr+2*n);
    for(int i = 0; i < n; i++)
    {
        if(arr[i] == arr[2*n-1-i])
        {
            cout<<"NO";
            return 0;
        }
    }
    if(n % 2 == 0 && arr[n/2] == arr[n/2-1])
        cout<<"NO";
    else
        cout<<"YES";
}


#include <algorithm>
#include <iostream>
#include <vector>

template <typename T>
std::istream& operator >>(std::istream& input, std::vector<T>& v)
{
    for (T& a : v)
        input >> a;

    return input;
}

void answer(bool v)
{
    constexpr const char* s[2] = { "NO", "YES" };
    std::cout << s[v] << '\n';
}

void solve(std::vector<unsigned>& a)
{
    const size_t n = a.size();

    std::sort(a.begin(), a.end());

    answer(a[n/2] < a[n/2+1]);
}

int main()
{
    size_t n;
    std::cin >> n;

    std::vector<unsigned> a(2 * n);
    std::cin >> a;

    solve(a);

    return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

template <typename T>
std::istream& operator >>(std::istream& input, std::vector<T>& v)
{
    for (T& a : v)
        input >> a;

    return input;
}

void answer(bool v)
{
    constexpr const char* s[2] = { "NO", "YES" };
    std::cout << s[v] << '\n';
}

void solve(std::vector<unsigned>& a)
{
    const size_t n = a.size();

    std::sort(a.begin(), a.end());

    answer(a[n/2-1] < a[n/2]);
}

int main()
{
    size_t n;
    std::cin >> n;

    std::vector<unsigned> a(2 * n);
    std::cin >> a;

    solve(a);

    return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

template <typename T>
std::istream& operator >>(std::istream& input, std::vector<T>& v)
{
    for (T& a : v)
        input >> a;

    return input;
}

void answer(bool v)
{
    constexpr const char* s[2] = { "NO", "YES" };
    std::cout << s[v] << '\n';
}

void solve(std::vector<unsigned>& a)
{
    const size_t n = a.size() / 2;

    std::sort(a.begin(), a.end());

    answer(a[n-1] < a[n]);
}

int main()
{
    size_t n;
    std::cin >> n;

    std::vector<unsigned> a(2 * n);
    std::cin >> a;

    solve(a);

    return 0;
}


#include<bits/stdc++.h>
#define int long long int
#define pb push_back
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define vvi vector<vector<int>>
#define vi vector<int>
#define f first
#define s second
using namespace std;
const int mod=1e9+7;
int logi(int n){int p=0;while(n/2){n=n/2;p++;}return p;}
int poww(int x,int y){int pro=1;while(y){if(y&1)pro=((pro%mod)*(x%mod)%mod);y=y>>1;x=((x%mod)*(x%mod)%mod);}return pro;}
int poww2(int x,int y){int pro=1;while(y){if(y&1)pro=pro*x;y=y>>1;x=x*x;}return pro;}
bool isprime(int n){ if(n==1) return false; for(int i=2;i<=sqrt(n);i++)	if(n%i==0) return false; return true;}
vector<vector<int>> adj(2e5);
vi visited(2e5,0);
/*

*/

int solve()
{
	int n,s1=0,s2=0;
	cin>>n;
	vi v(n*2);
	for(int i=0;i<n*2;i++)
	{
		cin>>v[i];
		s1+=v[i];
	}
	sort(v.begin(),v.end());
	int l=n-1,r=n*2-1;
	for(int i=0;i<n;i++)
	{
		if(v[l]>=v[r]) return cout<<"NO",0;
		l--;r--;
	}
	return cout<<"YES",0;
}

int32_t main() {
	fast;
	int t=1;
	//cin>>t;
	while(t--) {
		solve();
	}
}


#include<bits/stdc++.h>
#define int long long int
#define pb push_back
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define vvi vector<vector<int>>
#define vi vector<int>
#define f first
#define s second
using namespace std;
const int mod=1e9+7;
int logi(int n){int p=0;while(n/2){n=n/2;p++;}return p;}
int poww(int x,int y){int pro=1;while(y){if(y&1)pro=((pro%mod)*(x%mod)%mod);y=y>>1;x=((x%mod)*(x%mod)%mod);}return pro;}
int poww2(int x,int y){int pro=1;while(y){if(y&1)pro=pro*x;y=y>>1;x=x*x;}return pro;}
bool isprime(int n){ if(n==1) return false; for(int i=2;i<=sqrt(n);i++)	if(n%i==0) return false; return true;}
vector<vector<int>> adj(2e5);
vi visited(2e5,0);
/*

*/

int solve()
{
	int n,s1=0,s2=0;
	cin>>n;
	vi v(n*2);
	for(int i=0;i<n*2;i++)
	{
		cin>>v[i];
		s1+=v[i];
	}
	sort(v.begin(),v.end(),greater<int>());
	for(int i=0;i<n;i++)
	{
		s2+=v[i];
	}
	int x=s1-s2;
	if(s2>x) cout<<"YES";
	else cout<<"NO";
}

int32_t main() {
	fast;
	int t=1;
	//cin>>t;
	while(t--) {
		solve();
	}
}


#include<bits/stdc++.h>
#define int long long int
#define pb push_back
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define vvi vector<vector<int>>
#define vi vector<int>
#define f first
#define s second
using namespace std;
const int mod=1e9+7;
int logi(int n){int p=0;while(n/2){n=n/2;p++;}return p;}
int poww(int x,int y){int pro=1;while(y){if(y&1)pro=((pro%mod)*(x%mod)%mod);y=y>>1;x=((x%mod)*(x%mod)%mod);}return pro;}
int poww2(int x,int y){int pro=1;while(y){if(y&1)pro=pro*x;y=y>>1;x=x*x;}return pro;}
bool isprime(int n){ if(n==1) return false; for(int i=2;i<=sqrt(n);i++)	if(n%i==0) return false; return true;}
vector<vector<int>> adj(2e5);
vi visited(2e5,0);
/*

*/

int solve()
{
	int n,s1=0,s2=0;
	cin>>n;
	vi v(n*2);
	for(int i=0;i<n*2;i++)
	{
		cin>>v[i];
		s1+=v[i];
	}
	sort(v.begin(),v.end());
	int l=n-1,r=n;
	if(v[r]>v[l]) cout<<"YES";
	else cout<<"NO";
}

int32_t main() {
	fast;
	int t=1;
	//cin>>t;
	while(t--) {
		solve();
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,i;
    cin>>n;
    int a[2*n+1];
    for(i=0;i<2*n;i++){
        cin>>a[i];
    }
    sort(a,a+2*n);
    int result1=0;
    int result2=0;
    for(i=0;i<n;i++){
        result1+=a[i];
    }
    for(i=n;i<2*n;i++){
        result2+=a[i];
    }
    if(a[n-1] < a[n]){
       printf("YES\n");
    }
    else{
       printf("NO\n");
    }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,i;
    cin>>n;
    int a[2*n+1];
    for(i=0;i<2*n;i++){
        cin>>a[i];
    }
    sort(a,a+2*n);
    int result1=0;
    int result2=0;
    for(i=0;i<n;i++){
        result1+=a[i];
    }
    for(i=n;i<2*n;i++){
        result2+=a[i];
    }
    if(result1<result2){
        printf("YES\n");
    }
    else{
        printf("NO\n");
    }

}


#include <bits/stdc++.h>
using namespace std;

const int mod = 1e9 + 7, x = 864197532, N = 587, logN = 17;

int main () {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector <int> a(n * 2);
    for (int &i : a) cin >> i;
    sort(a.begin(), a.end());
    cout << (a[n - 1] < a[n] ? "YES\n" : "NO\n");
}


#include <bits/stdc++.h>
using namespace std;

const int mod = 1e9 + 7, x = 864197532, N = 587, logN = 17;

int main () {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector <int> a(n * 2);
    for (int &i : a) cin >> i;
    sort(a.begin(), a.end());
    bool is = true;
    if (a[0] == a[2 * n - 1]) cout << "NO\n";
    else cout << "YES\n";
}


#include <bits/stdc++.h>
using namespace std;

const int mod = 1e9 + 7, x = 864197532, N = 587, logN = 17;

int main () {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector <int> a(n * 2);
    for (int &i : a) cin >> i;
    sort(a.begin(), a.end());
    bool is = true;
    for (int i = 0; i < n; ++i) {
        is &= a[i] < a[n + i];
    }
    cout << (is ? "YES\n" : "NO\n");
}