/*
 * Package: StandardCodeLibrary.Core
 * */
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <utility>
#include <vector>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <bitset>
#include <complex>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <climits>
#if __GNUC__>=4 and __GNUC_MINOR__>=6
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/tag_and_trait.hpp>
#endif
#ifdef  __GXX_EXPERIMENTAL_CXX0X__
#define typeof decltype
#endif
using namespace std;

#define lp for(;;)
#define repf(i,a,b) for (int i=(a);i<(b);++i)
#define rep(i,n) repf(i,0,n)
#define ft(i,a,b) for (int i=(a);i<=(b);++i)
#define fdt(i,a,b) for (int i=(a);i>=(b);--i)
#define feach(e,s) for (typeof((s).begin()) e=(s).begin();e!=(s).end();++e)
#define fsubset(subset,set) for (int subset=(set)&((set)-1);subset;subset=(subset-1)&(set))
#define forin(i,charset) for (cstr i=(charset);*i;i++)
#define whl while
#define rtn return
#define fl(x,y) memset((x),char(y),sizeof(x))
#define clr(x) fl(x,char(0))
#define cpy(x,y) memcpy(x,y,sizeof(x))
#define pb push_back
#define mp make_pair
#define ins insert
#define ers erase
#define lb lower_bound
#define ub upper_bound
#define rnk order_of_key
#define sel find_by_order
#define x first
#define y second
#define sz(x) (int((x).size()))
#define all(x) (x).begin(),(x).end()
#define srt(x) sort(all(x))
#define uniq(x) srt(x),(x).erase(unique(all(x)),(x).end())
#define rev(x) reverse(all(x))
#define vec vector
#define pr pair
#define que queue
#define prq priority_queue
#define itr iterator
#define sf scanf
#define pf printf
#define pdb(prcs,x) (cout<<setprecision(prcs)<<fixed<<(sgn(x)?(x):0))
#ifdef DEBUG
#define prt(x) cerr<<#x"="<<(x)<<endl
#define asrtWA(s) do if(!(s))do{cerr<<"assert("#s")"<<endl;}whl(0);whl(0)
#define asrtTLE(s) do if(!(s))do{cerr<<"assert("#s")"<<endl;}whl(0);whl(0)
#define asrtMLE(s) do if(!(s))do{cerr<<"assert("#s")"<<endl;}whl(0);whl(0)
#define asrtOLE(s) do if(!(s))do{cerr<<"assert("#s")"<<endl;}whl(0);whl(0)
#define asrtRE(s) do if(!(s))do{cerr<<"assert("#s")"<<endl;}whl(0);whl(0)
#define runtime() cerr<<"Used: "<<db(clock())/CLOCKS_PER_SEC<<"s"<<endl
#define input(in) do{}whl(0)
#define output(out) do{}whl(0)
#else
#define endl (char('\n'))
#define prt(x) (cerr)
#define asrtWA(s) do if(!(s))exit(0);whl(0)
#define asrtTLE(s) do if(!(s))whl(1);whl(0)
#define asrtMLE(s) do if(!(s))whl(new int);whl(0)
#define asrtOLE(s) do if(!(s))whl(1)puts("OLE");whl(0)
#define asrtRE(s) do if(!(s))*(int*)0=0;whl(0)
#define runtime() (cerr)
#define input(in) freopen(in,"r",stdin)
#define output(out) freopen(out,"w",stdout)
#endif

typedef long long int lli;
typedef double db;
typedef const char* cstr;
typedef string str;
typedef vec<int> vi;
typedef vec<vi> vvi;
typedef vec<bool> vb;
typedef vec<vb> vvb;
typedef vec<str> vs;
typedef pr<int,int> pii;
typedef pr<lli,lli> pll;
typedef pr<db,db> pdd;
typedef map<int,int> mii;
typedef map<str,int> msi;
typedef map<char,int> mci;
typedef set<int> si;
typedef set<str> ss;
typedef que<int> qi;
typedef vec<pii> vpii;
typedef vec<pdd> vpdd;
#if __GNUC__>=4 and __GNUC_MINOR__>=6
using __gnu_cxx::rope;
#endif
#if __GNUC__>=4 and __GNUC_MINOR__>=7
template<typename key,typename value>class ext_map:public __gnu_pbds::tree<key,value,less<key>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>{};
template<typename key>class ext_set:public __gnu_pbds::tree<key,__gnu_pbds::null_type,less<key>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>{};
#elif __GNUC__>=4 and __GNUC_MINOR__>=6
template<typename key,typename value>class ext_map:public __gnu_pbds::tree<key,value,less<key>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>{};
template<typename key>class ext_set:public __gnu_pbds::tree<key,__gnu_pbds::null_mapped_type,less<key>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>{};
#endif

int oo=(~0u)>>1;
lli ooll=(~0ull)>>1;
db inf=1e+10;
db eps=1e-10;
db gam=0.5772156649015328606;
db pi=acos(-1.0);
int dx[]={1,0,-1,0,1,-1,-1,1,0};
int dy[]={0,1,0,-1,1,1,-1,-1,0};
int MOD=1000000007;

template<typename type>inline bool cmax(type& a,const type& b){rtn a<b?a=b,true:false;}
template<typename type>inline bool cmin(type& a,const type& b){rtn b<a?a=b,true:false;}
template<typename type>inline type sqr(const type& x){rtn x*x;}
inline int sgn(const db& x){rtn (x>+eps)-(x<-eps);}
inline int dbcmp(const db& a,const db& b){rtn sgn(a-b);}
template<typename istream,typename first_type,typename second_type>inline istream& operator>>(istream& cin,pr<first_type,second_type>& x){rtn cin>>x.x>>x.y;}
template<typename ostream,typename first_type,typename second_type>inline ostream& operator<<(ostream& cout,const pr<first_type,second_type>& x){rtn cout<<x.x<<" "<<x.y;}
template<typename istream,typename type>inline istream& operator>>(istream& cin,vec<type>& x){rep(i,sz(x))cin>>x[i];rtn cin;}
template<typename ostream,typename type>inline ostream& operator<<(ostream& cout,vec<type>& x){rep(i,sz(x))cout<<x[i]<<(i+1==sz(x)?"":" ");rtn cout;}
template<typename type>inline pr<type,type> operator-(const pr<type,type>& x){rtn mp(-x.x,-x.y);}
template<typename type>inline pr<type,type> operator+(const pr<type,type>& a,const pr<type,type>& b){rtn mp(a.x+b.x,a.y+b.y);}
template<typename type>inline pr<type,type> operator-(const pr<type,type>& a,const pr<type,type>& b){rtn mp(a.x-b.x,a.y-b.y);}
template<typename type>inline pr<type,type> operator*(const pr<type,type>& a,const type& b){rtn mp(a.x*b,a.y*b);}
template<typename type>inline pr<type,type> operator/(const pr<type,type>& a,const type& b){rtn mp(a.x/b,a.y/b);}
template<typename type>inline pr<type,type>& operator-=(pr<type,type>& a,const pr<type,type>& b){rtn a=a-b;}
template<typename type>inline pr<type,type>& operator+=(pr<type,type>& a,const pr<type,type>& b){rtn a=a+b;}
template<typename type>inline pr<type,type>& operator*=(pr<type,type>& a,const type& b){rtn a=a*b;}
template<typename type>inline pr<type,type>& operator/=(pr<type,type>& a,const type& b){rtn a=a/b;}
template<typename type>inline type cross(const pr<type,type>& a,const pr<type,type>& b){rtn a.x*b.y-a.y*b.x;}
template<typename type>inline type dot(const pr<type,type>& a,const pr<type,type>& b){rtn a.x*b.x+a.y*b.y;}
template<typename type>inline type gcd(type a,type b){if(b)whl((a%=b)&&(b%=a));rtn a+b;}
template<typename type>inline type lcm(type a,type b){rtn a*b/gcd(a,b);}
template<typename type>inline void bit_inc(vec<type>& st,int x,type inc){whl(x<sz(st))st[x]+=inc,x|=x+1;}
template<typename type>inline type bit_sum(const vec<type>& st,int x){type s=0;whl(x>=0)s+=st[x],x=(x&(x+1))-1;rtn s;}
template<typename type>inline type bit_kth(const vec<type>& st,int k){int x=0,y=0,z=0;whl((1<<(++y))<=sz(st));fdt(i,y-1,0){if((x+=1<<i)>sz(st)||z+st[x-1]>k)x-=1<<i;else z+=st[x-1];}rtn x;}
inline void make_set(vi& st){rep(i,sz(st))st[i]=i;}
inline int find_set(vi& st,int x){int y=x,z;whl(y!=st[y])y=st[y];whl(x!=st[x])z=st[x],st[x]=y,x=z;rtn y;}
inline bool union_set(vi& st,int a,int b){a=find_set(st,a),b=find_set(st,b);rtn a!=b?st[a]=b,true:false;}
template<typename type>inline void merge(type& a,type& b){if(sz(a)<sz(b))swap(a,b);whl(sz(b))a.ins(*b.begin()),b.ers(b.begin());}

struct Initializer{Initializer(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}~Initializer(){runtime();}}initializer;

int cnt(str s)
{
	int ans=0;
	rep(i,sz(s)) if (s[i]=='1') ans++;
	rtn ans;
}

bool calc(str a,str b)
{
	rtn cnt(a)>=cnt(b);
}

int main()
{
//	str a,b;
//	cin>>a>>b;
//	cout<<(calc(a,b)?"YES":"NO")<<endl;
	int n,m,k;
	cin>>n>>m>>k;
	vi a(n),b(m);
	cin>>a>>b;
	mii cnt;
	rep(i,sz(a)) cnt[a[i]]++;
	rep(i,sz(b)) cnt[b[i]]--;
	bool ans=false;
	int sum=0;
	for (mii::reverse_iterator i=cnt.rbegin();i!=cnt.rend();i++)
	{
		sum+=i->y;
		if (sum>0) ans=true;
	}
	cout<<(ans?"YES":"NO")<<endl;
}


/*
 * Package: StandardCodeLibrary.Core
 * */
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <utility>
#include <vector>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <bitset>
#include <complex>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <climits>
#if __GNUC__>=4 and __GNUC_MINOR__>=6
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/tag_and_trait.hpp>
#endif
#ifdef  __GXX_EXPERIMENTAL_CXX0X__
#define typeof decltype
#endif
using namespace std;

#define lp for(;;)
#define repf(i,a,b) for (int i=(a);i<(b);++i)
#define rep(i,n) repf(i,0,n)
#define ft(i,a,b) for (int i=(a);i<=(b);++i)
#define fdt(i,a,b) for (int i=(a);i>=(b);--i)
#define feach(e,s) for (typeof((s).begin()) e=(s).begin();e!=(s).end();++e)
#define fsubset(subset,set) for (int subset=(set)&((set)-1);subset;subset=(subset-1)&(set))
#define forin(i,charset) for (cstr i=(charset);*i;i++)
#define whl while
#define rtn return
#define fl(x,y) memset((x),char(y),sizeof(x))
#define clr(x) fl(x,char(0))
#define cpy(x,y) memcpy(x,y,sizeof(x))
#define pb push_back
#define mp make_pair
#define ins insert
#define ers erase
#define lb lower_bound
#define ub upper_bound
#define rnk order_of_key
#define sel find_by_order
#define x first
#define y second
#define sz(x) (int((x).size()))
#define all(x) (x).begin(),(x).end()
#define srt(x) sort(all(x))
#define uniq(x) srt(x),(x).erase(unique(all(x)),(x).end())
#define rev(x) reverse(all(x))
#define vec vector
#define pr pair
#define que queue
#define prq priority_queue
#define itr iterator
#define sf scanf
#define pf printf
#define pdb(prcs,x) (cout<<setprecision(prcs)<<fixed<<(sgn(x)?(x):0))
#ifdef DEBUG
#define prt(x) cerr<<#x"="<<(x)<<endl
#define asrtWA(s) do if(!(s))do{cerr<<"assert("#s")"<<endl;}whl(0);whl(0)
#define asrtTLE(s) do if(!(s))do{cerr<<"assert("#s")"<<endl;}whl(0);whl(0)
#define asrtMLE(s) do if(!(s))do{cerr<<"assert("#s")"<<endl;}whl(0);whl(0)
#define asrtOLE(s) do if(!(s))do{cerr<<"assert("#s")"<<endl;}whl(0);whl(0)
#define asrtRE(s) do if(!(s))do{cerr<<"assert("#s")"<<endl;}whl(0);whl(0)
#define runtime() cerr<<"Used: "<<db(clock())/CLOCKS_PER_SEC<<"s"<<endl
#define input(in) do{}whl(0)
#define output(out) do{}whl(0)
#else
#define endl (char('\n'))
#define prt(x) (cerr)
#define asrtWA(s) do if(!(s))exit(0);whl(0)
#define asrtTLE(s) do if(!(s))whl(1);whl(0)
#define asrtMLE(s) do if(!(s))whl(new int);whl(0)
#define asrtOLE(s) do if(!(s))whl(1)puts("OLE");whl(0)
#define asrtRE(s) do if(!(s))*(int*)0=0;whl(0)
#define runtime() (cerr)
#define input(in) freopen(in,"r",stdin)
#define output(out) freopen(out,"w",stdout)
#endif

typedef long long int lli;
typedef double db;
typedef const char* cstr;
typedef string str;
typedef vec<int> vi;
typedef vec<vi> vvi;
typedef vec<bool> vb;
typedef vec<vb> vvb;
typedef vec<str> vs;
typedef pr<int,int> pii;
typedef pr<lli,lli> pll;
typedef pr<db,db> pdd;
typedef map<int,int> mii;
typedef map<str,int> msi;
typedef map<char,int> mci;
typedef set<int> si;
typedef set<str> ss;
typedef que<int> qi;
typedef vec<pii> vpii;
typedef vec<pdd> vpdd;
#if __GNUC__>=4 and __GNUC_MINOR__>=6
using __gnu_cxx::rope;
#endif
#if __GNUC__>=4 and __GNUC_MINOR__>=7
template<typename key,typename value>class ext_map:public __gnu_pbds::tree<key,value,less<key>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>{};
template<typename key>class ext_set:public __gnu_pbds::tree<key,__gnu_pbds::null_type,less<key>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>{};
#elif __GNUC__>=4 and __GNUC_MINOR__>=6
template<typename key,typename value>class ext_map:public __gnu_pbds::tree<key,value,less<key>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>{};
template<typename key>class ext_set:public __gnu_pbds::tree<key,__gnu_pbds::null_mapped_type,less<key>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>{};
#endif

int oo=(~0u)>>1;
lli ooll=(~0ull)>>1;
db inf=1e+10;
db eps=1e-10;
db gam=0.5772156649015328606;
db pi=acos(-1.0);
int dx[]={1,0,-1,0,1,-1,-1,1,0};
int dy[]={0,1,0,-1,1,1,-1,-1,0};
int MOD=1000000007;

template<typename type>inline bool cmax(type& a,const type& b){rtn a<b?a=b,true:false;}
template<typename type>inline bool cmin(type& a,const type& b){rtn b<a?a=b,true:false;}
template<typename type>inline type sqr(const type& x){rtn x*x;}
inline int sgn(const db& x){rtn (x>+eps)-(x<-eps);}
inline int dbcmp(const db& a,const db& b){rtn sgn(a-b);}
template<typename istream,typename first_type,typename second_type>inline istream& operator>>(istream& cin,pr<first_type,second_type>& x){rtn cin>>x.x>>x.y;}
template<typename ostream,typename first_type,typename second_type>inline ostream& operator<<(ostream& cout,const pr<first_type,second_type>& x){rtn cout<<x.x<<" "<<x.y;}
template<typename istream,typename type>inline istream& operator>>(istream& cin,vec<type>& x){rep(i,sz(x))cin>>x[i];rtn cin;}
template<typename ostream,typename type>inline ostream& operator<<(ostream& cout,vec<type>& x){rep(i,sz(x))cout<<x[i]<<(i+1==sz(x)?"":" ");rtn cout;}
template<typename type>inline pr<type,type> operator-(const pr<type,type>& x){rtn mp(-x.x,-x.y);}
template<typename type>inline pr<type,type> operator+(const pr<type,type>& a,const pr<type,type>& b){rtn mp(a.x+b.x,a.y+b.y);}
template<typename type>inline pr<type,type> operator-(const pr<type,type>& a,const pr<type,type>& b){rtn mp(a.x-b.x,a.y-b.y);}
template<typename type>inline pr<type,type> operator*(const pr<type,type>& a,const type& b){rtn mp(a.x*b,a.y*b);}
template<typename type>inline pr<type,type> operator/(const pr<type,type>& a,const type& b){rtn mp(a.x/b,a.y/b);}
template<typename type>inline pr<type,type>& operator-=(pr<type,type>& a,const pr<type,type>& b){rtn a=a-b;}
template<typename type>inline pr<type,type>& operator+=(pr<type,type>& a,const pr<type,type>& b){rtn a=a+b;}
template<typename type>inline pr<type,type>& operator*=(pr<type,type>& a,const type& b){rtn a=a*b;}
template<typename type>inline pr<type,type>& operator/=(pr<type,type>& a,const type& b){rtn a=a/b;}
template<typename type>inline type cross(const pr<type,type>& a,const pr<type,type>& b){rtn a.x*b.y-a.y*b.x;}
template<typename type>inline type dot(const pr<type,type>& a,const pr<type,type>& b){rtn a.x*b.x+a.y*b.y;}
template<typename type>inline type gcd(type a,type b){if(b)whl((a%=b)&&(b%=a));rtn a+b;}
template<typename type>inline type lcm(type a,type b){rtn a*b/gcd(a,b);}
template<typename type>inline void bit_inc(vec<type>& st,int x,type inc){whl(x<sz(st))st[x]+=inc,x|=x+1;}
template<typename type>inline type bit_sum(const vec<type>& st,int x){type s=0;whl(x>=0)s+=st[x],x=(x&(x+1))-1;rtn s;}
template<typename type>inline type bit_kth(const vec<type>& st,int k){int x=0,y=0,z=0;whl((1<<(++y))<=sz(st));fdt(i,y-1,0){if((x+=1<<i)>sz(st)||z+st[x-1]>k)x-=1<<i;else z+=st[x-1];}rtn x;}
inline void make_set(vi& st){rep(i,sz(st))st[i]=i;}
inline int find_set(vi& st,int x){int y=x,z;whl(y!=st[y])y=st[y];whl(x!=st[x])z=st[x],st[x]=y,x=z;rtn y;}
inline bool union_set(vi& st,int a,int b){a=find_set(st,a),b=find_set(st,b);rtn a!=b?st[a]=b,true:false;}
template<typename type>inline void merge(type& a,type& b){if(sz(a)<sz(b))swap(a,b);whl(sz(b))a.ins(*b.begin()),b.ers(b.begin());}

struct Initializer{Initializer(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}~Initializer(){runtime();}}initializer;

int cnt(str s)
{
	int ans=0;
	rep(i,sz(s)) if (s[i]=='1') ans++;
	rtn ans;
}

bool calc(str a,str b)
{
	rtn cnt(a)>=cnt(b);
}

int main()
{
//	str a,b;
//	cin>>a>>b;
//	cout<<(calc(a,b)?"YES":"NO")<<endl;
	int n,m,k;
	cin>>n>>m>>k;
	vi a(n),b(m);
	cin>>a>>b;
	mii cnt;
	rep(i,sz(a)) cnt[a[i]]++;
	rep(i,sz(b)) cnt[b[i]]--;
	bool ans=false;
	feach(i,cnt) if (i->y>0) ans=true;
	cout<<(ans?"YES":"NO")<<endl;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cassert>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <complex>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <functional>
#include <iterator>

using namespace std;

#define dump(n) cout<<"# "<<#n<<'='<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(c)
#define mp make_pair

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<string> vs;
typedef pair<int,int> pii;

const int INFTY=1<<29;
const double EPS=1e-9;

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
	return os<<'('<<p.first<<','<<p.second<<')';
}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& a){
	os<<'[';
	rep(i,a.size()) os<<(i?" ":"")<<a[i];
	return os<<']';
}

int main()
{
	for(int n,m,k;cin>>n>>m>>k;){
		vi a(n),b(m);
		rep(i,n) cin>>a[i]; sort(all(a));
		rep(i,m) cin>>b[i]; sort(all(b));

		bool res=false;
		while(!a.empty()){
			if(b.empty() || a.back()>b.back()){
				res=true;
				break;
			}
			a.pop_back();
			b.pop_back();
		}
		cout<<(res?"YES":"NO")<<endl;
	}

	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <map>
using namespace std;

bool solve(int nA, int nB, int k)
{
	vector<int> a(nA); for(auto& ai : a) cin>>ai;
	vector<int> b(nB); for(auto& bi : b) cin>>bi;

	map<int, pair<int,int>> cnt;
	for(auto& ai : a)
		cnt[ai].first++;
	for(auto& bi : b)
		cnt[bi].second++;

	int at=0, bt=0;
	for(map<int,pair<int,int>>::reverse_iterator it=cnt.rbegin(); it!=cnt.rend(); ++it) {
		at += it->second.first;
		bt += it->second.second;
		if(at > bt)
			return true;
	}
	return false;
}

int main()
{
	for(int n,m,k; cin>>n>>m>>k; )
		cout << (solve(n,m,k) ? "YES" : "NO") << endl;
}


//Copyright (c) Nguyen Huy Truong Nam
#pragma comment(linker, "/STACK:0x04000000")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <cctype>
#include <cassert>
#include <climits>
#include <ctime>
#include <algorithm>
#include <iterator>
#include <string>
#include <vector>
#include <deque>
#include <set>
#include <map>

using namespace std;
typedef unsigned int uint;
typedef long long i64;
typedef unsigned long long ui64;
typedef long double ld;

vector<int> a;
vector<int> b;
map<int, int> quan_a_map;
map<int, int> quan_b_map;
vector<pair<int, int>> quan_a;
vector<pair<int, int>> quan_b;

int main() {
#ifdef NOVACO
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int n;
    int m;
    int k;
    cin >> n >> m >> k;
    a.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        quan_a_map[a[i]]++;
    }
    sort(a.begin(), a.end());
    a.resize(distance(a.begin(), unique(a.begin(), a.end())));
    quan_a.assign(quan_a_map.begin(), quan_a_map.end());
    b.reserve(m);
    for (int i = 0; i < m; i++) {
        int num;
        cin >> num;
        int num_pos = distance(a.begin(), upper_bound(a.begin(), a.end(), num));
        if (num_pos == 0) {
            continue;
        }
        num_pos--;
        quan_b_map[a[num_pos]]++;
    }
    quan_b.assign(quan_b_map.begin(), quan_b_map.end());
    int i = quan_a.size() - 1;
    int j = quan_b.size() - 1;
    while (true) {
        if (i >= 0 && j < 0) {
            cout << "YES\n";
            return 0;
        }
        if (i < 0 || j < 0) {
            break;
        }
        if (quan_a[i].first > quan_b[j].first) {
            cout << "YES\n";
            return 0;
        }
        int quan = min(quan_a[i].second, quan_b[j].second);
        quan_a[i].second -= quan;
        quan_b[j].second -= quan;
        if (quan_a[i].second == 0) {
            i--;
        }
        if (quan_b[j].second == 0) {
            j--;
        }
    }
    cout << "NO\n";
}


#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <vector>
#include <queue>
#include <fstream>
#include <sstream>
#include <map>
#include <list>
#include <cmath>
#include <bitset>
#include <stack>
#include <stdio.h>
#include <cstring>
#include <ctime>
#include <ctype.h>
#include <utility>
#include <stdlib.h>
#include <stdio.h>
#include <cstdio>
using namespace std;

#define mod 1000000007
#define ll long long
#define INF 1000000000
#define PI 3.1415926

vector<int> alice, bob;

int main (void)
{

    //ifstream cin("in.txt");
    //ofstream cout("out.txt");

    int n, m, k;
    cin >> n >> m >> k;

    for (int i = 0; i < n; i++)
    {
        int p;
        cin >> p;
        alice.push_back(p);
    }

    for (int i = 0; i < m; i++)
    {
        int p;
        cin >> p;
        bob.push_back(p);
    }

    sort(alice.begin(), alice.end());
    sort(bob.begin(), bob.end());

    int score = 0;
    bool pos = false;

    int inda = alice.size() - 1;
    int indb = bob.size() - 1;

    while (true)
    {
        if (alice[inda] == bob[indb])
        {
            inda--;
            indb--;
        } else if (alice[inda] > bob[indb])
        {
            score++;
            inda--;
        } else
        {
            score--;
            indb--;
        }

        if (score > 0)
        {
            pos = true;
            break;
        }

        if (inda < 0 || indb < 0)
            break;
    }

    if (pos)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;

    //while (true) {}

}


#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <vector>
#include <queue>
#include <fstream>
#include <sstream>
#include <map>
#include <list>
#include <cmath>
#include <bitset>
#include <stack>
#include <stdio.h>
#include <cstring>
#include <ctime>
#include <ctype.h>
#include <utility>
#include <stdlib.h>
#include <stdio.h>
#include <cstdio>
using namespace std;

#define mod 1000000007
#define ll long long
#define INF 1000000000
#define PI 3.1415926

vector<int> alice, bob;

int main (void)
{

    //ifstream cin("in.txt");
    //ofstream cout("out.txt");

    int n, m, k;
    cin >> n >> m >> k;

    for (int i = 0; i < n; i++)
    {
        int p;
        cin >> p;
        alice.push_back(p);
    }

    for (int i = 0; i < m; i++)
    {
        int p;
        cin >> p;
        bob.push_back(p);
    }

    sort(alice.begin(), alice.end());
    sort(bob.begin(), bob.end());

    int score = 0;
    bool pos = false;

    int inda = alice.size() - 1;
    int indb = bob.size() - 1;

    while (true)
    {
        if (alice[inda] == bob[indb])
        {
            inda--;
            indb--;
        } else if (alice[inda] > bob[indb])
        {
            score++;
            inda--;
        } else
        {
            score--;
            indb--;
        }

        if (score > 0)
        {
            pos = true;
            break;
        }

        if (indb < 0)
        {
            score += inda + 1;

            if (score > 0)
            {
                pos = true;
                break;
            }
        }

        if (inda < 0 || indb < 0)
            break;
    }

    if (pos)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;

    //while (true) {}

}


#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <iterator>
#include <set>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstring>
#include <string>
#include <queue>
#include <stack>
#include <list>
#include <sstream>
#include <ctype.h>
#include <utility>
#include <cstdlib>
#include <functional>
#include <numeric>

using namespace std;

#define DEBUG(x) { cerr << #x << " = " << x << endl; }
#define ll long long
#define lINF 998877665544332211ll
#define INF 987654321ll
#define MOD 1000000007ll
#define ADD(v) accumulate(v.begin(),v.end(), 0)
#define PRO(v) accumulate(v.begin(),v.end(), 1,multiplies <int>())
ll POS(ll x) { if (x > 0)  return x; else return 0; }
#define maxe(v) max_element(v.begin(),v.end())
#define mine(v) min_element(v.begin(),v.end())
#define rep(k,a,b) for(int k=(a); k < (b); ++k)
#define per(k,a,b) for(int k=(b-1); k >= (a); --k)
bool has[100005];
int main() {
    int n, m, k, cn = 0;
    cin >> n >> m >> k;
    vector <int> a(n), b(m);
    rep(i, 0, n) {
        cin >> a[i];
        has[a[i]] = 1;
    }
    rep(i, 0, m) {
        cin >> b[i];
        if (has[b[i]])
            cn++;
    }
    if (n > m) {
        cout << "YES" << endl;
        return 0;
    }
    if (cn >= n && n <= m) {
        cout << "NO" << endl;
        return 0;
    }
    sort(a.rbegin(), a.rend());
    sort(b.rbegin(), b.rend());
    rep(i, 0, n) {
        if (a[i] > b[i]) {
            cout << "YES" << endl;
            return 0;
        }
    }
    cout << "NO" << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <iterator>
#include <set>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstring>
#include <string>
#include <queue>
#include <stack>
#include <list>
#include <sstream>
#include <ctype.h>
#include <utility>
#include <cstdlib>
#include <functional>
#include <numeric>

using namespace std;

#define DEBUG(x) { cerr << #x << " = " << x << endl; }
#define ll long long
#define lINF 998877665544332211ll
#define INF 987654321ll
#define MOD 1000000007ll
#define ADD(v) accumulate(v.begin(),v.end(), 0)
#define PRO(v) accumulate(v.begin(),v.end(), 1,multiplies <int>())
ll POS(ll x) { if (x > 0)  return x; else return 0; }
#define maxe(v) max_element(v.begin(),v.end())
#define mine(v) min_element(v.begin(),v.end())
#define rep(k,a,b) for(int k=(a); k < (b); ++k)
#define per(k,a,b) for(int k=(b-1); k >= (a); --k)
map <int,bool> has;
int main() {
    int n, m, k, cn = 0;
    cin >> n >> m >> k;
    vector <int> a(n), b(m);
    rep(i, 0, n) {
        cin >> a[i];
        has[a[i]] = 1;
    }
    rep(i, 0, m) {
        cin >> b[i];
        if (has[b[i]])
            cn++;
    }
    if (n > m) {
        cout << "YES" << endl;
        return 0;
    }
    if (cn >= n && n < m) {
        cout << "NO" << endl;
        return 0;
    }
    sort(a.rbegin(), a.rend());
    sort(b.rbegin(), b.rend());
    rep(i, 0, n) {
        if (a[i] > b[i]) {
            cout << "YES" << endl;
            return 0;
        }
    }
    cout << "NO" << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <iterator>
#include <set>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstring>
#include <string>
#include <queue>
#include <stack>
#include <list>
#include <sstream>
#include <ctype.h>
#include <utility>
#include <cstdlib>
#include <functional>
#include <numeric>

using namespace std;

#define DEBUG(x) { cerr << #x << " = " << x << endl; }
#define ll long long
#define lINF 998877665544332211ll
#define INF 987654321ll
#define MOD 1000000007ll
#define ADD(v) accumulate(v.begin(),v.end(), 0)
#define PRO(v) accumulate(v.begin(),v.end(), 1,multiplies <int>())
ll POS(ll x) { if (x > 0)  return x; else return 0; }
#define maxe(v) max_element(v.begin(),v.end())
#define mine(v) min_element(v.begin(),v.end())
#define rep(k,a,b) for(int k=(a); k < (b); ++k)
#define per(k,a,b) for(int k=(b-1); k >= (a); --k)
map <int,bool> has;
int main() {
    int n, m, k, cn = 0;
    cin >> n >> m >> k;
    vector <int> a(n), b(m);
    rep(i, 0, n) {
        cin >> a[i];
        has[a[i]] = 1;
    }
    rep(i, 0, m) {
        cin >> b[i];
        if (has[b[i]])
            cn++;
    }
    if (n > m) {
        cout << "YES" << endl;
        return 0;
    }
    if (cn >= n && n <= m) {
        cout << "NO" << endl;
        return 0;
    }
    sort(a.rbegin(), a.rend());
    sort(b.rbegin(), b.rend());
    rep(i, 0, n) {
        if (a[i] > b[i]) {
            cout << "YES" << endl;
            return 0;
        }
    }
    cout << "NO" << endl;
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
//#pragma comment(linker, "/STACK:100000000")
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <stdio.h>
#include <vector>
#include <map>
#include <time.h>
#include <memory.h>
#include <queue>

#define ll long long
#define ld long double
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pi 3.141592653589793238462643383279
ll gcd(ll a, ll b) {
	while (a && b){	if (a>b) a%=b; else b%=a;}
	return a+b;
}

ll lcm(ll a, ll b) { return (((a) / gcd(a, b)))*b; }

int phi(int n){
	int result = n;
	for (int i = 2; i*i <= n; i++) {
		if (n % i == 0) {
			while (n % i == 0) n /= i;
			result -= result / i;
		}
	}
	if (n > 1) result -= result / n;
	return result;
}

ll power(ll a, ll b, ll c){
	ll r = 1;
	while (b){
		if (b & 1) r *= a;
		a *= a;
		a %= c;
		r %= c;
		b /= 2;
	}
	return r;
}

#define MAX 5000100
#define INF 1000000007
#define eps 0.0001
#define ls (v << 1)
#define rs ((v << 1)+1)
#define y1 privet
#define nmax 200010

void nxi(int& n){
	bool min = 0; char c; n = 0;
	while ((c = getc(stdin)) && c <= 32);
	if (c == '-') min = 1; else n = c - 48;
	while ((c = getc(stdin)) && c>32) n = (n << 3) + (n << 1) + c - 48;
	if (min) n = -n;
}

void prl(int n){
	if (n == 0) { puts("0"); return; }
	static int s[10];
	int top = 0;
	while (n>0) s[top++] = n % 10, n /= 10;
	while (top--) putchar(s[top] + 48);
	puts("");
}
using namespace std;

int n, m, k;
int a[MAX], b[MAX];

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

int main()
{
	//freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);

	cin >> n >> m >> k;
	for (int i=0; i<n; i++) cin >> a[i];
	for (int i=0; i<m; i++) cin >> b[i];
	sort(a, a+n, cmp); sort(b,b+m, cmp);
    int p1=0, p2=0;
    while (p1<n && p2<m) {
       if (a[p1]==b[p2]) p1++, p2++; else
       if (a[p1]>b[p2]) p1++; else { puts("YES"); exit(0); };
    }

    cout << "NO\n";

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
//#pragma comment(linker, "/STACK:100000000")
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <stdio.h>
#include <vector>
#include <map>
#include <time.h>
#include <memory.h>
#include <queue>

#define ll long long
#define ld long double
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pi 3.141592653589793238462643383279
ll gcd(ll a, ll b) {
	while (a && b){	if (a>b) a%=b; else b%=a;}
	return a+b;
}

ll lcm(ll a, ll b) { return (((a) / gcd(a, b)))*b; }

int phi(int n){
	int result = n;
	for (int i = 2; i*i <= n; i++) {
		if (n % i == 0) {
			while (n % i == 0) n /= i;
			result -= result / i;
		}
	}
	if (n > 1) result -= result / n;
	return result;
}

ll power(ll a, ll b, ll c){
	ll r = 1;
	while (b){
		if (b & 1) r *= a;
		a *= a;
		a %= c;
		r %= c;
		b /= 2;
	}
	return r;
}

#define MAX 5000100
#define INF 1000000007
#define eps 0.0001
#define ls (v << 1)
#define rs ((v << 1)+1)
#define y1 privet
#define nmax 200010

void nxi(int& n){
	bool min = 0; char c; n = 0;
	while ((c = getc(stdin)) && c <= 32);
	if (c == '-') min = 1; else n = c - 48;
	while ((c = getc(stdin)) && c>32) n = (n << 3) + (n << 1) + c - 48;
	if (min) n = -n;
}

void prl(int n){
	if (n == 0) { puts("0"); return; }
	static int s[10];
	int top = 0;
	while (n>0) s[top++] = n % 10, n /= 10;
	while (top--) putchar(s[top] + 48);
	puts("");
}
using namespace std;

int n, m, k;
int a[MAX], b[MAX];

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

int main()
{
	//freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);

	cin >> n >> m >> k;
	for (int i=0; i<n; i++) cin >> a[i];
	for (int i=0; i<m; i++) cin >> b[i];
	sort(a, a+n, cmp); sort(b,b+m, cmp);
    int p1=0, p2=0;
    while (p1<n && p2<m) {
       if (a[p1]<=b[p2]) p1++, p2++; else { puts("YES"); exit(0); };
    }
if (n>m) puts("YES"); else
    cout << "NO\n";

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
//#pragma comment(linker, "/STACK:100000000")
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <stdio.h>
#include <vector>
#include <map>
#include <time.h>
#include <memory.h>
#include <queue>

#define ll long long
#define ld long double
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pi 3.141592653589793238462643383279
ll gcd(ll a, ll b) {
	while (a && b){	if (a>b) a%=b; else b%=a;}
	return a+b;
}

ll lcm(ll a, ll b) { return (((a) / gcd(a, b)))*b; }

int phi(int n){
	int result = n;
	for (int i = 2; i*i <= n; i++) {
		if (n % i == 0) {
			while (n % i == 0) n /= i;
			result -= result / i;
		}
	}
	if (n > 1) result -= result / n;
	return result;
}

ll power(ll a, ll b, ll c){
	ll r = 1;
	while (b){
		if (b & 1) r *= a;
		a *= a;
		a %= c;
		r %= c;
		b /= 2;
	}
	return r;
}

#define MAX 5000100
#define INF 1000000007
#define eps 0.0001
#define ls (v << 1)
#define rs ((v << 1)+1)
#define y1 privet
#define nmax 200010

void nxi(int& n){
	bool min = 0; char c; n = 0;
	while ((c = getc(stdin)) && c <= 32);
	if (c == '-') min = 1; else n = c - 48;
	while ((c = getc(stdin)) && c>32) n = (n << 3) + (n << 1) + c - 48;
	if (min) n = -n;
}

void prl(int n){
	if (n == 0) { puts("0"); return; }
	static int s[10];
	int top = 0;
	while (n>0) s[top++] = n % 10, n /= 10;
	while (top--) putchar(s[top] + 48);
	puts("");
}
using namespace std;

int n, m, k;
int a[MAX], b[MAX];

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

int main()
{
	//freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);

	cin >> n >> m >> k;
	for (int i=0; i<n; i++) cin >> a[i];
	for (int i=0; i<m; i++) cin >> b[i];
	sort(a, a+n, cmp); sort(b,b+m, cmp);
    int p1=0, p2=0;
    while (p1<n && p2<m) {
       if (a[p1]==b[p2]) p1++, p2++; else { puts("YES"); exit(0); };
    }
    if (n>m) puts("YES"); else

    cout << "NO\n";

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
//#pragma comment(linker, "/STACK:100000000")
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <stdio.h>
#include <vector>
#include <map>
#include <time.h>
#include <memory.h>
#include <queue>

#define ll long long
#define ld long double
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pi 3.141592653589793238462643383279
ll gcd(ll a, ll b) {
	while (a && b){	if (a>b) a%=b; else b%=a;}
	return a+b;
}

ll lcm(ll a, ll b) { return (((a) / gcd(a, b)))*b; }

int phi(int n){
	int result = n;
	for (int i = 2; i*i <= n; i++) {
		if (n % i == 0) {
			while (n % i == 0) n /= i;
			result -= result / i;
		}
	}
	if (n > 1) result -= result / n;
	return result;
}

ll power(ll a, ll b, ll c){
	ll r = 1;
	while (b){
		if (b & 1) r *= a;
		a *= a;
		a %= c;
		r %= c;
		b /= 2;
	}
	return r;
}

#define MAX 5000100
#define INF 1000000007
#define eps 0.0001
#define ls (v << 1)
#define rs ((v << 1)+1)
#define y1 privet
#define nmax 200010

void nxi(int& n){
	bool min = 0; char c; n = 0;
	while ((c = getc(stdin)) && c <= 32);
	if (c == '-') min = 1; else n = c - 48;
	while ((c = getc(stdin)) && c>32) n = (n << 3) + (n << 1) + c - 48;
	if (min) n = -n;
}

void prl(int n){
	if (n == 0) { puts("0"); return; }
	static int s[10];
	int top = 0;
	while (n>0) s[top++] = n % 10, n /= 10;
	while (top--) putchar(s[top] + 48);
	puts("");
}
using namespace std;

int n, m, k;
int a[MAX], b[MAX];

int main()
{
	//freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);

	cin >> n >> m >> k;
	for (int i=0; i<n; i++) cin >> a[i];
	for (int i=0; i<m; i++) cin >> b[i];
	sort(a, a+n); sort(b,b+m);
	if (a[n-1]<=b[m-1]) puts("YES"); else puts("NO");

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
//#pragma comment(linker, "/STACK:100000000")
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <stdio.h>
#include <vector>
#include <map>
#include <time.h>
#include <memory.h>
#include <queue>

#define ll long long
#define ld long double
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pi 3.141592653589793238462643383279
ll gcd(ll a, ll b) {
	while (a && b){	if (a>b) a%=b; else b%=a;}
	return a+b;
}

ll lcm(ll a, ll b) { return (((a) / gcd(a, b)))*b; }

int phi(int n){
	int result = n;
	for (int i = 2; i*i <= n; i++) {
		if (n % i == 0) {
			while (n % i == 0) n /= i;
			result -= result / i;
		}
	}
	if (n > 1) result -= result / n;
	return result;
}

ll power(ll a, ll b, ll c){
	ll r = 1;
	while (b){
		if (b & 1) r *= a;
		a *= a;
		a %= c;
		r %= c;
		b /= 2;
	}
	return r;
}

#define MAX 5000100
#define INF 1000000007
#define eps 0.0001
#define ls (v << 1)
#define rs ((v << 1)+1)
#define y1 privet
#define nmax 200010

void nxi(int& n){
	bool min = 0; char c; n = 0;
	while ((c = getc(stdin)) && c <= 32);
	if (c == '-') min = 1; else n = c - 48;
	while ((c = getc(stdin)) && c>32) n = (n << 3) + (n << 1) + c - 48;
	if (min) n = -n;
}

void prl(int n){
	if (n == 0) { puts("0"); return; }
	static int s[10];
	int top = 0;
	while (n>0) s[top++] = n % 10, n /= 10;
	while (top--) putchar(s[top] + 48);
	puts("");
}
using namespace std;

int n, m, k;
int a[MAX], b[MAX];

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

int main()
{
	//freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);

	cin >> n >> m >> k;
	for (int i=0; i<n; i++) cin >> a[i];
	for (int i=0; i<m; i++) cin >> b[i];
	sort(a, a+n, cmp); sort(b,b+m, cmp);
    int p1=0, p2=0;
    while (p1<n && p2<m) {
       if (a[p1]<=b[p2]) p1++, p2++; else { puts("YES"); exit(0); };
    }
    cout << "NO\n";

	return 0;
}


#include<stdio.h>
#include<algorithm>
#define For(i,n) for(int i=1; i<=n; i++)
#define Rep(i,n) for(int i=0; i<n; i++)
#include<set>
#include<map>

using namespace std;

int n,m,k;
int main(){
#ifndef ONLINE_JUDGE
  freopen("in.txt","r",stdin);
#endif
  map<int,int> a,b;
  set<int> st;
  scanf("%d%d%d",&n,&m,&k);
  int t;
  For(i,n){
    scanf("%d",&t);
    a[t]++;
    st.insert(t);
  }
  For(j,m){
    scanf("%d",&t);
    b[t]++;
    st.insert(t);
  }
  int flag=0;
  for(set<int>::iterator it=st.begin(); it!=st.end(); ++it){
    int cur=*it;
    //printf("%d %d %d\n",cur,a[cur],b[cur]);
    if(flag){
      if(a[cur]>b[cur])
	flag+=a[cur]-b[cur];
      else if(a[cur]<b[cur])
	flag-=min(flag,b[cur]-a[cur]);
    }else{
      if(a[cur]>b[cur])
	flag=a[cur]-b[cur];
      else
	flag=0;
    }
  }
  printf("%s",flag?"YES":"NO");
  return 0;
}


#include<stdio.h>
#include<algorithm>
#define For(i,n) for(int i=1; i<=n; i++)
#define Rep(i,n) for(int i=0; i<n; i++)
#include<set>
#include<map>

using namespace std;

int n,m,k;
int main(){
#ifndef ONLINE_JUDGE
  freopen("in.txt","r",stdin);
#endif
  map<int,int> a,b;
  set<int> st;
  scanf("%d%d%d",&n,&m,&k);
  int t;
  For(i,n){
    scanf("%d",&t);
    a[t]++;
    st.insert(t);
  }
  For(j,n){
    scanf("%d",&t);
    b[t]++;
    st.insert(t);
  }
  int flag=0;
  for(set<int>::iterator it=st.begin(); it!=st.end(); ++it){
    int cur=*it;
    //printf("%d %d %d\n",cur,a[cur],b[cur]);
    if(flag){
      if(a[cur]>b[cur])
	flag+=a[cur]-b[cur];
      else if(a[cur]<b[cur])
	flag-=min(flag,b[cur]-a[cur]);
    }else{
      if(a[cur]>b[cur])
	flag=a[cur]-b[cur];
      else
	flag=0;
    }
  }
  printf("%s",flag?"YES":"NO");
  return 0;
}


#include <functional>/*{{{*/
#include <algorithm>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>
using namespace std;typedef long long ll;typedef long double real;void run();int main(){ios::sync_with_stdio(0);run();}/*}}}*/

map<int,int> fum;

int alice[100000];
int   bob[100000];
int  diff[200000];

void run(){
  int n,m,k; cin>>n>>m>>k;
  for (int i=0; i<n; i++) cin>>alice[i], fum[alice[i]]=0;
  for (int i=0; i<n; i++) cin>>bob[i],   fum[bob[i]]=0;
  int fish=0;
  for (auto it=fum.begin(); it!=fum.end(); ++it) it->second=fish++;
  for (int i=0; i<n; i++) ++diff[fum[alice[i]]];
  for (int i=0; i<m; i++) --diff[fum[bob[i]]];

  for (int i=fish; i-->1;){
    if (diff[i]<=0){
      diff[i-1]+=diff[i];
    }
    else{
      diff[0]=1;
      break;
    }
  }
  cout<<(diff[0]>0?"YES":"NO")<<endl;
}


#include <functional>/*{{{*/
#include <algorithm>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>
using namespace std;typedef long long ll;typedef long double real;void run();int main(){ios::sync_with_stdio(0);run();}/*}}}*/

map<int,int> fum;

int alice[100000];
int   bob[100000];
int  diff[200000];

void run(){
  int n,m,k; cin>>n>>m>>k;
  for (int i=0; i<n; i++) cin>>alice[i], fum[alice[i]]=0;
  for (int i=0; i<m; i++) cin>>bob[i],   fum[bob[i]]=0;
  int fish=0;
  for (auto it=fum.begin(); it!=fum.end(); ++it) it->second=fish++;
  for (int i=0; i<n; i++) ++diff[fum[alice[i]]];
  for (int i=0; i<m; i++) --diff[fum[bob[i]]];

  for (int i=fish; i-->1;){
    if (diff[i]<=0){
      diff[i-1]+=diff[i];
    }
    else{
      diff[0]=1;
      break;
    }
  }
  cout<<(diff[0]>0?"YES":"NO")<<endl;
}


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

int n,m,k,c;
map<int,int,greater<int>> seq;

int main() {
    cin >> n >> m >> k;
    for (int i = 0; i < n; ++i) cin >> k, seq[k]++;
    for (int i = 0; i < m; ++i) cin >> k, seq[k]--;

    for (auto& p : seq) {
        c += p.second;
        if (c > 0) {
            cout << "YES" << endl;
            return 0;
        }
    }
    cout << "NO" << endl;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string.h>

using namespace std;
#define mp make_pair
typedef long long ll;

int n, m, k, a[1000000], b[1000000], w[1000000], q;
map<int, int> c1, c2;
int main()
{
    scanf("%d %d %d", &n, &m, &k);
    for (int i=0;i<n;++i) scanf("%d", &a[i]), ++c1[a[i]], w[q++]=a[i];
    for (int i=0;i<m;++i) scanf("%d", &b[i]), ++c2[b[i]], w[q++]=b[i];
    sort(w, w+q); q=unique(w, w+q)-w;
    int a1=0, a2=0;
    while (q)
    {
        --q;
        int g1=c1[w[q]]+a1, g2=c2[w[q]]+a2;
        if (g1>g2) { puts("YES"); return 0; }
        a1=g1; a2=g2;
    }
    puts("NO");
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string.h>

using namespace std;
#define mp make_pair
typedef long long ll;

int n, m, k, a[1000000], b[1000000], w[1000000], q;
map<int, int> c1, c2;
int main()
{
    scanf("%d %d %d", &n, &m, &k);
    for (int i=0;i<n;++i) scanf("%d", &a[i]), ++c1[a[i]], w[q++]=a[i];
    for (int i=0;i<n;++i) scanf("%d", &b[i]), ++c2[b[i]], w[q++]=b[i];
    sort(w, w+q); q=unique(w, w+q)-w;
    int a1=0, a2=0;
    while (q)
    {
        --q;
        int g1=c1[w[q]]+a1, g2=c2[w[q]]+a2;
        if (g1>g2) { puts("YES"); return 0; }
        a1=g1; a2=g2;
    }
    puts("NO");
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <ctime>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <cstring>
#include <iterator>
#include <fstream>
#include <set>
using namespace std;

#define pb push_back
#define rs resize
#define mp make_pair
#define inf 1e9
#define pi 3.1415926535897932384626433832795
#define sz(a) (int)(a).size()
#define Sort(a) sort((a).begin(), (a).end())
#define Reverse(a) reverse((a).begin(), (a).end())
#define sf scanf
#define pf printf
#define ms(a, x) memset((a), (x), sizeof(a))
typedef vector <int> vi;
typedef vector <vi> vvi;
typedef vector <vvi> vvvi;
typedef vector <vvvi> vvvvi;
typedef vector <bool> vb;
typedef vector <vb> vvb;
typedef vector <vvb> vvvb;
typedef vector <vvvb> vvvvb;
typedef long long ll;
typedef vector <ll> vl;
typedef vector <vl> vvl;
typedef vector <vvl> vvvl;
typedef vector <vvvl> vvvvl;
typedef pair <int, int> ii;
typedef vector <ii> vii;
typedef vector <vii> vvii;
typedef pair <int, ll> il;
typedef vector <il> vil;
typedef vector <vil> vvil;
typedef pair <ll, int> li;
typedef vector <li> vli;
typedef vector <vli> vvli;
typedef set <int> si;
typedef set <li> sli;
typedef set <il> sil;
typedef vector <string> vs;
typedef vector <vs> vvs;
typedef vector <vvs> vvvs;
typedef map <string, int> msi;
typedef map <char, int> mci;
typedef pair <ll, ll> pll;

int main() {
	int n, m, k;
	cin >> n >> m >> k;
	vi a(n), b(m);
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	for (int i = 0; i < m; ++i) {
		cin >> b[i];
	}
	Sort(a);
	Sort(b);
	Reverse(a);
	Reverse(b);
	if (n > m) {
		cout << "YES";
		return 0;
	}
	for (int i = 0; i < n; ++i) {
		if (a[i] > b[i]) {
			cout << "YES";
			return 0;
		}
	}
	cout << "NO";
	return 0;
}


#include <iostream>
#include <map>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    int n,m,k;
    cin>>n>>m>>k;
    map<int,int> Alice,Bob;
    for(int c=0;c<n;c++)
    {
        int type;
        cin>>type;
        Alice[type]++;
        Bob[type]=0;
    }
    for(int c=0;c<m;c++)
    {
        int type;
        cin>>type;
        Bob[type]++;
    }
    int sup = 0;
    for(map<int,int>::iterator it = Bob.begin(); it != Bob.end();it++)
    {
        sup += Alice[it->first] - (it->second);
        sup = max(sup,0);
    }
    cout<<(sup > 0? "YES":"NO");
}


#include <cstdio>
#include <fstream>
#ifndef localhost
#include <iostream>
#else
#include <iostream>
#endif
#include <sstream>
#include <stdlib.h>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <unordered_map>
#include <map>
#include <set>
#include <math.h>
#define M_PI    3.14159265358979323846  /* pi */
#define ri(i) int i;cin>>i;
#define rii(i,j) int i,j;cin>>i>>j;
#define riii(i,j,k) int i,j,k;cin>>i>>j>>k;
#define rc(i) char i;cin>>i;
#define rll(i) long long i;cin>>i;
#define ff(i,s,n) for(int i=(s);i<(n);i++)
#define fff(i,s,n) for(i=(s);i<(n);i++)
#define fr(i,s,n) for(int i=(n-1);i>=(s);i--)
#define frf(i,s,n) for(i=(n-1);i>=(s);i--)
#define FF(i,s,n) for(int i=(s);i<=(n);i++)
#define FFf(i,s,n) for(i=(s);i<=(n);i++)
#define Fr(i,s,n) for(int i=(n);i>=(s);i--)
#define Frf(i,s,n) for(i=(n);i>=(s);i--)
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()

template<typename T, typename U> inline void swap(T &a, U &b) {
    a = a^b;
    b = a^b;
    a = a^b;
}

inline void swap(int &a, int &b) {
    a = a^b;
    b = a^b;
    a = a^b;
}

inline void swap(long long &a, long long &b) {
    a = a^b;
    b = a^b;
    a = a^b;
}

template<typename T, typename U> inline void smax(T &a, U b) {
    if (b > a)a = b;
}

template<typename T, typename U> inline void smin(T &a, U b) {
    if (b < a)a = b;
}

inline int gcd(int a, int b) {
    if (a < b)swap(a, b);
    while (b > 0) {
        a %= b;
        swap(a, b);
    }
    return a;
}

long long nchose(int a, int b) {
    long long ans = 1;
    smax(a, b - a);
    int p = 2;

    FF(i, b - a + 1, b) {
        ans *= (long long) i;
        while (p <= a && ans % p == 0)ans /= p++;
    }
    return ans;
}

using namespace std;
static long long MOD = 1000003;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll > vvll;
typedef pair<vi, vi> pvi;
typedef vector<vi > vvi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pair<string, string> > vpss;
typedef vector<pii > vpii;
typedef vector<pll > vpll;
typedef vector<vpii > vvpii;
typedef map<int, int> mii;
typedef unordered_map<int, int> imap;
typedef unordered_map<ll, ll> lmap;

int n,m,k;
vi a,b;
int main(){
    cin>>n>>m>>k;a.resize(k),b.resize(k);
    ff(i,0,n){
        ri(t);
        a[t-1]++;
    }
    ff(i,0,m){
        ri(t);
        b[t-1]++;
    }
    ff(i,0,k){
        if(a[i]>b[i]){
            cout<<"YES";
            return 0;
        }
    }
    cout<<"NO";
}


#include <cstdio>
#include <fstream>
#ifndef localhost
#include <iostream>
#else
#include <iostream>
#endif
#include <sstream>
#include <stdlib.h>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <unordered_map>
#include <map>
#include <set>
#include <math.h>
#define M_PI    3.14159265358979323846  /* pi */
#define ri(i) int i;cin>>i;
#define rii(i,j) int i,j;cin>>i>>j;
#define riii(i,j,k) int i,j,k;cin>>i>>j>>k;
#define rc(i) char i;cin>>i;
#define rll(i) long long i;cin>>i;
#define ff(i,s,n) for(int i=(s);i<(n);i++)
#define fff(i,s,n) for(i=(s);i<(n);i++)
#define fr(i,s,n) for(int i=(n-1);i>=(s);i--)
#define frf(i,s,n) for(i=(n-1);i>=(s);i--)
#define FF(i,s,n) for(int i=(s);i<=(n);i++)
#define FFf(i,s,n) for(i=(s);i<=(n);i++)
#define Fr(i,s,n) for(int i=(n);i>=(s);i--)
#define Frf(i,s,n) for(i=(n);i>=(s);i--)
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()

template<typename T, typename U> inline void swap(T &a, U &b) {
    a = a^b;
    b = a^b;
    a = a^b;
}

inline void swap(int &a, int &b) {
    a = a^b;
    b = a^b;
    a = a^b;
}

inline void swap(long long &a, long long &b) {
    a = a^b;
    b = a^b;
    a = a^b;
}

template<typename T, typename U> inline void smax(T &a, U b) {
    if (b > a)a = b;
}

template<typename T, typename U> inline void smin(T &a, U b) {
    if (b < a)a = b;
}

inline int gcd(int a, int b) {
    if (a < b)swap(a, b);
    while (b > 0) {
        a %= b;
        swap(a, b);
    }
    return a;
}

long long nchose(int a, int b) {
    long long ans = 1;
    smax(a, b - a);
    int p = 2;

    FF(i, b - a + 1, b) {
        ans *= (long long) i;
        while (p <= a && ans % p == 0)ans /= p++;
    }
    return ans;
}

using namespace std;
static long long MOD = 1000003;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll > vvll;
typedef pair<vi, vi> pvi;
typedef vector<vi > vvi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pair<string, string> > vpss;
typedef vector<pii > vpii;
typedef vector<pll > vpll;
typedef vector<vpii > vvpii;
typedef map<int, int> mii;
typedef unordered_map<int, int> imap;
typedef unordered_map<ll, ll> lmap;

int n,m,k;
map<int ,pii> v;
int main(){
    cin>>n>>m>>k;a.resize(k),b.resize(k);
    ff(i,0,n){
        ri(t);
        v[t].first++;
    }
    ff(i,0,m){
        ri(t);
        v[t].second++;
    }
    for(pair<int,pii> p:v){
        if(p.second.first>p.second.second){
            cout<<"YES";return 0;
        }
    }
    cout<<"NO";
}


#include <cstdio>
#include <fstream>
#ifndef localhost
#include <iostream>
#else
#include <iostream>
#endif
#include <sstream>
#include <stdlib.h>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <unordered_map>
#include <map>
#include <set>
#include <math.h>
#define M_PI    3.14159265358979323846  /* pi */
#define ri(i) int i;cin>>i;
#define rii(i,j) int i,j;cin>>i>>j;
#define riii(i,j,k) int i,j,k;cin>>i>>j>>k;
#define rc(i) char i;cin>>i;
#define rll(i) long long i;cin>>i;
#define ff(i,s,n) for(int i=(s);i<(n);i++)
#define fff(i,s,n) for(i=(s);i<(n);i++)
#define fr(i,s,n) for(int i=(n-1);i>=(s);i--)
#define frf(i,s,n) for(i=(n-1);i>=(s);i--)
#define FF(i,s,n) for(int i=(s);i<=(n);i++)
#define FFf(i,s,n) for(i=(s);i<=(n);i++)
#define Fr(i,s,n) for(int i=(n);i>=(s);i--)
#define Frf(i,s,n) for(i=(n);i>=(s);i--)
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()

template<typename T, typename U> inline void swap(T &a, U &b) {
    a = a^b;
    b = a^b;
    a = a^b;
}

inline void swap(int &a, int &b) {
    a = a^b;
    b = a^b;
    a = a^b;
}

inline void swap(long long &a, long long &b) {
    a = a^b;
    b = a^b;
    a = a^b;
}

template<typename T, typename U> inline void smax(T &a, U b) {
    if (b > a)a = b;
}

template<typename T, typename U> inline void smin(T &a, U b) {
    if (b < a)a = b;
}

inline int gcd(int a, int b) {
    if (a < b)swap(a, b);
    while (b > 0) {
        a %= b;
        swap(a, b);
    }
    return a;
}

long long nchose(int a, int b) {
    long long ans = 1;
    smax(a, b - a);
    int p = 2;

    FF(i, b - a + 1, b) {
        ans *= (long long) i;
        while (p <= a && ans % p == 0)ans /= p++;
    }
    return ans;
}

using namespace std;
static long long MOD = 1000003;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll > vvll;
typedef pair<vi, vi> pvi;
typedef vector<vi > vvi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pair<string, string> > vpss;
typedef vector<pii > vpii;
typedef vector<pll > vpll;
typedef vector<vpii > vvpii;
typedef map<int, int> mii;
typedef unordered_map<int, int> imap;
typedef unordered_map<ll, ll> lmap;

int n,m,k,a,b;
map<int ,pii, greater<int> > v;
int main(){
    cin>>n>>m>>k;
    ff(i,0,n){
        ri(t);
        v[t].first++;
    }
    ff(i,0,m){
        ri(t);
        v[t].second++;
    }
    for(pair<int,pii> p:v){
        a+=p.second.first;
        b+=p.second.second;
        if(a>b){
            cout<<"YES";return 0;
        }
    }
    cout<<"NO";
}


#include <cstdio>
#include <fstream>
#ifndef localhost
#include <iostream>
#else
#include <iostream>
#endif
#include <sstream>
#include <stdlib.h>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <unordered_map>
#include <map>
#include <set>
#include <math.h>
#define M_PI    3.14159265358979323846  /* pi */
#define ri(i) int i;cin>>i;
#define rii(i,j) int i,j;cin>>i>>j;
#define riii(i,j,k) int i,j,k;cin>>i>>j>>k;
#define rc(i) char i;cin>>i;
#define rll(i) long long i;cin>>i;
#define ff(i,s,n) for(int i=(s);i<(n);i++)
#define fff(i,s,n) for(i=(s);i<(n);i++)
#define fr(i,s,n) for(int i=(n-1);i>=(s);i--)
#define frf(i,s,n) for(i=(n-1);i>=(s);i--)
#define FF(i,s,n) for(int i=(s);i<=(n);i++)
#define FFf(i,s,n) for(i=(s);i<=(n);i++)
#define Fr(i,s,n) for(int i=(n);i>=(s);i--)
#define Frf(i,s,n) for(i=(n);i>=(s);i--)
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()

template<typename T, typename U> inline void swap(T &a, U &b) {
    a = a^b;
    b = a^b;
    a = a^b;
}

inline void swap(int &a, int &b) {
    a = a^b;
    b = a^b;
    a = a^b;
}

inline void swap(long long &a, long long &b) {
    a = a^b;
    b = a^b;
    a = a^b;
}

template<typename T, typename U> inline void smax(T &a, U b) {
    if (b > a)a = b;
}

template<typename T, typename U> inline void smin(T &a, U b) {
    if (b < a)a = b;
}

inline int gcd(int a, int b) {
    if (a < b)swap(a, b);
    while (b > 0) {
        a %= b;
        swap(a, b);
    }
    return a;
}

long long nchose(int a, int b) {
    long long ans = 1;
    smax(a, b - a);
    int p = 2;

    FF(i, b - a + 1, b) {
        ans *= (long long) i;
        while (p <= a && ans % p == 0)ans /= p++;
    }
    return ans;
}

using namespace std;
static long long MOD = 1000003;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll > vvll;
typedef pair<vi, vi> pvi;
typedef vector<vi > vvi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pair<string, string> > vpss;
typedef vector<pii > vpii;
typedef vector<pll > vpll;
typedef vector<vpii > vvpii;
typedef map<int, int> mii;
typedef unordered_map<int, int> imap;
typedef unordered_map<ll, ll> lmap;

int n,m,k;
map<int ,pii> v;
int main(){
    cin>>n>>m>>k;
    ff(i,0,n){
        ri(t);
        v[t].first++;
    }
    ff(i,0,m){
        ri(t);
        v[t].second++;
    }
    for(pair<int,pii> p:v){
        if(p.second.first>p.second.second){
            cout<<"YES";return 0;
        }
    }
    cout<<"NO";
}


#include<cstdio>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<map>
#include<stack>
#include<cmath>
#include<iomanip>
#include <map>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<string>
#include<cassert>
using namespace std;

#define DEBUG //on-off switch for prlling statements

// Input macros
#define s(n)                        scanf("%d",&n)
#define sc(n)                       scanf("%c",&n)
#define sl(n)                       scanf("%lld",&n)
#define sf(n)                       scanf("%lf",&n)
#define ss(n)                       scanf("%s",n)

// Useful constants
#define EPS                         1e-5

// Useful hardware instructions
#define bitcount1                    __builtin_popcount1
#define gcd                         __gcd

// Useful container manipulation / traversal macros
#define forall(i,a,b)               for(ll i=a;i<b;i++)
#define foreach(v, c)               for( typeof( (c).begin()) v = (c).begin();  v != (c).end(); ++v)
#define all(a)                      a.begin(), a.end()
#define in(a,b)                     ( (b).find(a) != (b).end())
#define pb                          push_back
#define fill(a,v)                    memset(a, v, sizeof a)
#define sz(a)                       ((ll)(a.size()))

// Some common useful functions
#define miN(a,b)                     ( (a) < (b) ? (a) : (b))
#define maX(a,b)                     ( (a) > (b) ? (a) : (b))

#define ll long long int
#define llu long long unsigned
#define ld long
#define INF 1000000000
#define mod 1000000007

 #define llu long long unsigned
#define ld long

#define S second
#define F first

int a[100001];
int b[100001];
int main()
{
    int n,m,k;
    s(n);
    s(m);
    s(k);
    for(int i=0;i<n;i++)
    {
        s(a[i]);
    }
    for(int i=0;i<m;i++)
    {
        s(b[i]);
    }
    sort(b,b+m);
    sort(a,a+n);
    if(n > m)
    {
        cout<<"YES"<<endl;
        return 0;
    }
    int offset=m-n;
    for(int i=0;i<n;i++)
    {
        if(a[i] > b[i+offset])
        {
            cout<<"YES"<<endl;
            return 0;
        }
    }
    cout<<"NO"<<endl;
}


#pragma comment(linker, "/STACK:16777216")
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

#ifndef ONLINE_JUDGE
#define Eo(x) { cerr << #x << " = " << (x) << endl; }
#else
#define Eo(x)
#endif

typedef long long int64;
const int inf = 0x3f3f3f3f;
const int64 inf64 = 0x3f3f3f3f3f3f3f3fLL;
typedef double real;
const real eps = 1e-6;
typedef pair<int64,int64> pip;

int64 gcd(int64 a, int64 b) {
  return a ? gcd(b%a,a) : b;
}

template <typename A,typename B>
ostream& operator<<(ostream& os, const pair<A,B>& p) {
                 return os << p.first << "," << p.second;
}

template <typename A>
ostream& operator<<(ostream& os, const vector<A>& v) {
                 for (int i = 0; i < v.size(); i++) {
                   os << v[i] << ";";
                 }
                 return os;
}

template <typename A>
ostream& operator<<(ostream& os, const set<A>& v) {
                 for (typename set<A>::const_iterator it = v.begin(); it != v.end(); ++it) {
                   os << *it << ";";
                 }
                 return os;
}

template <typename A, typename B>
ostream& operator<<(ostream& os, const map<A,B>& v) {
                 for (typename map<A,B>::const_iterator it = v.begin(); it != v.end(); ++it) {
                   os << it->first << "=" << it->second << ";";
                 }
                 return os;
}

inline int64 bit(int64 k) {
  return int64(1)<<k;
}

int SolveSquareEquation(real a, real b, real c, real& x1, real& x2) {
  real desc = b*b-4*a*c;
  if (desc<0) return 0;
  real sqrt_desc = sqrt(desc);
  x1 = (-b+sqrt_desc)/(2*a);
  x2 = (-b-sqrt_desc)/(2*a);
  if (desc<eps) {
    return 1;
  }
  return 2;
}

int SolveSquareEquationInt(int64 a, int64 b, int64 c, int64& x1, int64& x2) {
  int64 desc = b*b-4*a*c;
  if (desc<0) return 0;
  real sqrt_desc_r = sqrt(real(desc));
  int64 sqrt_desc = sqrt_desc_r;
  for (;sqrt_desc*sqrt_desc<desc; sqrt_desc++);
  for (;sqrt_desc*sqrt_desc>desc; sqrt_desc--);
  if (sqrt_desc*sqrt_desc != desc) {
    return 0;
  }
  int64 u1 = -b+sqrt_desc;
  int64 u2 = -b-sqrt_desc;
  int64 a2 = a*2;
  vector<int64> res;
  if (!(u1%a2)) {
    res.push_back(u1/a2);
  }
  if (!(u2%a2)) {
    res.push_back(u2/a2);
  }
  int oldsize = res.size();
  res.resize(2);
  x1=res[0];
  x2=res[1];
  return oldsize;
}

map<int,int> za,zb;
bool foo() {
  for (;;){
    if (za.size() && !zb.size()) {
      return true;
    }
    if (!za.size()) {
      return false;
    }
    int x = za.rbegin()->first;
    int y = zb.rbegin()->first;
    if (x>y) {
      return true;
    }
    int z = min(za.rbegin()->second, zb.rbegin()->second);
    za.rbegin()->second -= z;
    zb.rbegin()->second -= z;
    if (!za.rbegin()->second) {
      za.erase(za.rbegin()->first);
    }
    if (!zb.rbegin()->second) {
      zb.erase(zb.rbegin()->first);
    }
  }
  return 0;
}

int main() {
  int a,b,n; cin >> a >> b >> n;
  for (int i = 0; i < a; i++) {
    int x; scanf("%d",&x);
    za[x]++;
  }
  for (int i = 0; i < b; i++) {
    int x; scanf("%d",&x);
    zb[x]++;
  }
  puts(foo()?"YES":"NO");
  return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <climits>
#include <cstring>
#include <cctype>
#include <ctime>
#include <sstream>
#include <cassert>
#include <algorithm>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
using namespace std;

// <editor-fold defaultstate="collapsed" desc="Defines">

typedef long long ll;
typedef unsigned long long ull;
typedef pair<double, double> dd;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef pair<string, int> si;
typedef pair<double, ll> pdl;
typedef map<int, int> mi;
typedef map<string, int> msi;
typedef map<string, string> mss;
typedef map<char, int> mci;
typedef set<int> sei;
typedef vector<si> vsi;
typedef vector<dd> vdd;
typedef vector<char> vc;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;
typedef vector<string> vs;
const double PI = 3.14159265358979;
const double PI2 = 6.28318530717958;
const double PId2 = 1.570796326794895;
#define MP make_pair
#define X first
#define Y second
#define eps 1E-9
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()

template<typename T> T sqr(T x)
{
    return x*x;
}

template<typename T> T gcd(T a, T b)
{
    return (b ? gcd(b, a % b) : a);
}

ll pw(ll a, ll p, ll mod)
{
    ll res = 1;
    while (p) {
        if (p & 1) {
            --p;
            res = (res * a) % mod;
        } else {
            p >>= 1;
            a = (a * a) % mod;
        }
    }
    return res;
}

inline vi ReadVI(int count)
{
    vi array(count);
    for (int i = 0; i < count; i++)
        scanf("%d", &array[i]);
    return array;
}

inline vll ReadVlong(int count)
{
    vll arrayname(count);
    for (int i = 0; i < count; i++) cin >> arrayname[i];
    return arrayname;
}

const int MOD = 65536;
const int MOD2 = 1073741824;
const int MAXVALUE = 200010;

// </editor-fold >

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#else
    //freopen("longpath.in", "r", stdin);
    //freopen("longpath.out", "w", stdout);
#endif
    int n, m, k, t;
    cin >> n >> m >> k;
    vi a = ReadVI(n);
    vi b = ReadVI(m);
    sort(rall(a));
    sort(rall(b));
    int i = 0, j = 0;
    while (i < n && j < m) {
        if (a[i] > b[j]) return cout << "YES", 0;
        else i++, j++;
    }
    if (i < n) cout << "YES";
    else cout << "NO";
    return 0;
}


#include <iostream>
#include <cstdio>
#include <string.h>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

const int maxn = 200000 + 10;
int a[maxn], b[maxn];
int n, m, k;

bool solve()
{
	int ra = 0, rb = 0;
	int i = n - 1, j = m - 1;
	int now;
	while (i >= 0 || j >= 0) {
		if (i >= 0) now = a[i]; else now = 0;
		if (j >= 0) now = max(now, b[j]);
		while (i >= 0 && a[i] == now) {
			++ra;
			i--;
		}
		while (j >= 0 && b[j] == now) {
			++rb;
			j--;
		}
		if (ra > rb) return true;
	}
	return false;
}

int main()
{
		scanf("%d%d%d", &n, &m, &k);
		for (int i = 0; i != n; i++) scanf("%d", &a[i]);
		for (int j = 0; j != m; j++) scanf("%d", &b[j]);
		sort(a, a+n);
		sort(b, b+n);
		if (solve()) printf("YES\n");
		else printf("NO\n");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <string.h>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

const int maxn = 100000 + 10;
int a[maxn], b[maxn];
int n, m, k;

bool solve()
{
	int ra = 0, rb = 0;
	int i = n - 1, j = m - 1;
	int now = max(a[i], b[j]);
	while (i >= 0 || j >= 0) {
		if (i >= 0) now = a[i]; else now = 0;
		if (j >= 0) now = max(now, b[j]);
		while (i >= 0 && a[i] == now) {
			++ra;
			i--;
		}
		while (j >= 0 && b[j] == now) {
			++rb;
			j--;
		}
		if (ra > rb) return true;
	}
	return false;
}

int main()
{
	while (cin >> n >> m >> k) {
		for (int i = 0; i != n; i++) scanf("%d", &a[i]);
		for (int j = 0; j != m; j++) scanf("%d", &b[j]);
		sort(a, a+n);
		sort(b, b+n);
		if (solve()) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <string.h>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

const int maxn = 100000 + 10;
int a[maxn], b[maxn];
int n, m, k;

bool solve()
{
	int ra = 0, rb = 0;
	int i = n - 1, j = m - 1;
	while (i >= 0 && j >= 0) {
		if (a[i] > b[j]) {
			if (ra >= rb) return true;
			--rb;
			--i;
		} else if (a[i] < b[j]) {
			++rb;
			--j;
		} else if (a[i] == b[j]) {
			--i, --j;
		}
	}
	for (int t = 0; t <= j; t++) ++rb;
	for (int t = 0; t <= i; t++) ++ra;
	return ra > rb;
}

int main()
{
	while (cin >> n >> m >> k) {
		for (int i = 0; i != n; i++) scanf("%d", &a[i]);
		for (int j = 0; j != m; j++) scanf("%d", &b[j]);
		sort(a, a+n);
		sort(b, b+n);
		if (solve()) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <string.h>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

const int maxn = 100000 + 10;
int a[maxn], b[maxn];
int n, m, k;

bool solve()
{
	int ra = 0, rb = 0;
	int i = n - 1, j = m - 1;
	while (i >= 0 && j >= 0) {
		if (a[i] > b[j]) {
			if (ra >= rb) return true;
			--rb;
			--i;
		} else if (a[i] < b[j]) {
			++rb;
			--j;
		} else if (a[i] == b[j]) {
			--i, --j;
		}
	}
	for (int t = 0; t <= j; t++) ++rb;
	for (int t = 0; t <= i; t++) ++ra;
	return ra > rb;
}

int main()
{
	while (cin >> n >> m >> k) {
		for (int i = 0; i != n; i++) scanf("%d", &a[i]);
		for (int j = 0; j != m; j++) scanf("%d", &b[j]);
		sort(a, a+n);
		sort(b, b+m);
		if (solve()) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}


#include <vector>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <queue>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <list>
#include <ctime>
#include <string>
#include <cassert>

using namespace std;

int main() {
    int n, m, k;
    while(scanf("%d %d %d", &n, &m, &k)!=EOF) {
        vector<int> v1, v2;
        for(int i=0;i<n;i++) {
            int a; scanf("%d", &a);
            v1.push_back(a);
        }
        for(int i=0;i<m;i++) {
            int a; scanf("%d", &a);
            v2.push_back(a);
        }
        sort(v1.begin(), v1.end());
        reverse(v1.begin(), v1.end());
        sort(v2.begin(), v2.end());
        reverse(v2.begin(), v2.end());

        if(v1.size() > v2.size()) {
            puts("YES");
            continue;
        }
        for(int i=0;i<(int)v1.size();i++) {
            if(v1[i] > v2[i]) {
                puts("YES");
                return 0;
            }
        }
        puts("NO");
    }
}


include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstring>

#define InTheNameOfGod ios_base::sync_with_stdio(0);cin.tie(0);
#define rep(i,n) for (int i = 0; i < (n); i++)
#define N 300007

using namespace std;
vector<int> v, o;
int main()
{
    InTheNameOfGod

    int n, m, k;
    cin >> n >> m >> k;
    rep(i,n){
        int x; cin >> x;
        v.push_back(x);
    }
    rep(i,m){
        int x; cin >> x;
        o.push_back(x);
    }
    int sz = (int)max(v.size(), o.size());

    for (long i = v.size(); i < sz; i++)
        v.push_back(0);
    for (long i = o.size(); i < sz; i++)
        o.push_back(0);
    sort(v.begin(), v.end());
    sort(o.begin(), o.end());
    /*rep(i,v.size()) cerr << v[i] << ' ';
    cerr << endl;
    rep(i,o.size()) cerr << o[i] << ' ';
    cerr << endl;*/
    for (long i = v.size()-1; i >= 0; i--)
    {
        if (v[i] > o[i]){
            cout << "YES" << endl;
            return 0;
        }
    }
    cout << "NO";
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstring>

#define InTheNameOfGod ios_base::sync_with_stdio(0);cin.tie(0);
#define rep(i,n) for (int i = 0; i < (n); i++)
#define N 300007

using namespace std;
vector<int> v, o;
int main()
{
    InTheNameOfGod

    int n, m, k;
    cin >> n >> m >> k;
    rep(i,n){
        int x; cin >> x;
        v.push_back(x);
    }
    rep(i,m){
        int x; cin >> x;
        o.push_back(x);
    }
    int sz = (int)max(v.size(), o.size());

    for (long i = v.size(); i < sz; i++)
        v.push_back(0);
    for (long i = o.size(); i < sz; i++)
        o.push_back(0);
    sort(v.begin(), v.end());
    sort(o.begin(), o.end());
    /*rep(i,v.size()) cerr << v[i] << ' ';
    cerr << endl;
    rep(i,o.size()) cerr << o[i] << ' ';
    cerr << endl;*/
    for (long i = v.size()-1; i >= 0; i--)
    {
        if (v[i] > o[i]){
            cout << "YES" << endl;
            return 0;
        }
    }
    cout << "NO";
}


//Copyright @ 2013, Chow-Shing Shih, All rights reserved.
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <ctime>
#include <utility>
#include <iostream>
#include <cmath>
#define rep(i, n) for (int i = 1; i <= n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define INF 0x7fffffff
#define MP(x, y) (make_pair(x, y))
#define pb(x) push_back(x)
#define clr(a, b) memset(a, b, sizeof(a))

using namespace std;

typedef long long llu;

inline int Lowbit(int i){return i & (-i);}
inline void read(int &n)
{
    char c;
    for (c = getchar(); !(c >= '0' && c <= '9'); c = getchar());
    n = c - '0';
    for (c = getchar(); c >= '0' && c <= '9'; c = getchar()) n = n * 10 + c - '0';
}
int N, M, K, a[200000], b[200000];

int main()
{
    scanf("%d%d%d", &N, &M, &K);
    for (int i = 1; i <= N; ++i)    scanf("%d", &a[i]);
    for (int i = 1; i <= M; ++i)    scanf("%d", &b[i]);
    if (N > M)
    {
        puts("YES");
        return 0;
    }
    sort(a + 1, a + N + 1);
    sort(b + 1, b + M + 1);
    for (int i = 1; i <= N; ++i)
        if (a[i] > b[M - N + i])
        {
            puts("YES");
            return 0;
        }
    puts("NO");

    return 0;
}


//Copyright @ 2013, Chow-Shing Shih, All rights reserved.
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <ctime>
#include <utility>
#include <iostream>
#include <cmath>
#define rep(i, n) for (int i = 1; i <= n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define INF 0x7fffffff
#define MP(x, y) (make_pair(x, y))
#define pb(x) push_back(x)
#define clr(a, b) memset(a, b, sizeof(a))

using namespace std;

typedef long long llu;

inline int Lowbit(int i){return i & (-i);}
inline void read(int &n)
{
    char c;
    for (c = getchar(); !(c >= '0' && c <= '9'); c = getchar());
    n = c - '0';
    for (c = getchar(); c >= '0' && c <= '9'; c = getchar()) n = n * 10 + c - '0';
}
int N, M, K, a[200000], b[200000];

int main()
{
    scanf("%d%d%d", &N, &M, &K);
    for (int i = 1; i <= N; ++i)    scanf("%d", &a[i]);
    for (int i = 1; i <= M; ++i)    scanf("%d", &b[i]);
    if (N > M)
    {
        puts("YES");
        return 0;
    }
    sort(a + 1, a + N + 1);
    sort(b + 1, b + M + 1);
    for (int i = 1; i <= N; ++i)
        if (a[i] > b[i])
        {
            puts("YES");
            return 0;
        }
    puts("NO");

    return 0;
}


//Copyright @ 2013, Chow-Shing Shih, All rights reserved.
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <ctime>
#include <utility>
#include <iostream>
#include <cmath>
#define rep(i, n) for (int i = 1; i <= n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define INF 0x7fffffff
#define MP(x, y) (make_pair(x, y))
#define pb(x) push_back(x)
#define clr(a, b) memset(a, b, sizeof(a))

using namespace std;

typedef long long llu;

inline int Lowbit(int i){return i & (-i);}
inline void read(int &n)
{
    char c;
    for (c = getchar(); !(c >= '0' && c <= '9'); c = getchar());
    n = c - '0';
    for (c = getchar(); c >= '0' && c <= '9'; c = getchar()) n = n * 10 + c - '0';
}
int N, M, K, a[200000], b[200000];

int main()
{
    scanf("%d%d%d", &N, &M, &K);
    for (int i = 1; i <= N; ++i)    scanf("%d", &a[i]);
    for (int i = 1; i <= M; ++i)    scanf("%d", &b[i]);
    if (N > M)
    {
        puts("YES");
        return 0;
    }
    sort(a + 1, a + N + 1);
    sort(b + 1, b + N + 1);
    for (int i = 1; i <= N; ++i)
        if (a[i] > b[i])
        {
            puts("YES");
            return 0;
        }
    puts("NO");
    return 0;
}


//Copyright @ 2013, Chow-Shing Shih, All rights reserved.
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <ctime>
#include <utility>
#include <iostream>
#include <cmath>
#define rep(i, n) for (int i = 1; i <= n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define INF 0x7fffffff
#define MP(x, y) (make_pair(x, y))
#define pb(x) push_back(x)
#define clr(a, b) memset(a, b, sizeof(a))

using namespace std;

typedef long long llu;

inline int Lowbit(int i){return i & (-i);}
inline void read(int &n)
{
    char c;
    for (c = getchar(); !(c >= '0' && c <= '9'); c = getchar());
    n = c - '0';
    for (c = getchar(); c >= '0' && c <= '9'; c = getchar()) n = n * 10 + c - '0';
}
int N, M, K, a[200000], b[200000];

int main()
{
    scanf("%d%d%d", &N, &M, &K);
    for (int i = 1; i <= N; ++i)    scanf("%d", &a[i]);
    for (int i = 1; i <= M; ++i)    scanf("%d", &b[i]);
    if (N > M)
    {
        puts("YES");
        return 0;
    }
    sort(a + 1, a + N + 1);
    sort(b + 1, b + M + 1);
    for (int i = 1; i <= N; ++i)
        if (a[i] > b[M - i + 1])
        {
            puts("YES");
            return 0;
        }
    puts("NO");
      return 0;
}


//be name khoda

#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <iomanip>
#include <cmath>
using namespace std;

int ta[100100],tb[100100];

int main()
{
	int n,m,k;
	cin>>n>>m>>k;
	for(int i=0;i<n;i++)
		cin>>ta[i];
	for(int i=0;i<m;i++)
		cin>>tb[i];
	sort(ta,ta+n);
	sort(tb,tb+m);
	int j=0;
	for(int i=0;i<n;i++)
	{
		while(ta[i]>tb[j] && j<m)
			j++;
		if(j==m)
		{
			cout<<"YES"<<endl;
			return 0;
		}
		j++;
	}
	cout<<"NO"<<endl;
	return 0;
}


#ifdef MY_SUPER_PUPER_ONLINE_JUDGE
#include <fstream>
using namespace std;
ifstream cin("input.txt");
ofstream cout("output.txt");
#else
#include <iostream>
using namespace std;
#endif
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <map>
#include <string>
#include <iterator>
#include <set>

int main()
{
	std::multiset<int> v1, v2;
	int n, m, k;
	cin >> n >> m >> k;
	for(int i = 0; i < n; i++)
	{
		int t;
		cin >> t;
		v1.insert(t);
	}
	for(int i = 0; i < m; i++)
	{
		int t;
		cin >> t;
		v2.insert(t);
	}
	for(auto iter = v1.rbegin(); iter != v1.rend(); ++iter)
	{
		auto tmp = v2.lower_bound(*iter);
		if(tmp == v2.end()) return cout << "YES", 0;
		v2.erase(tmp);
	}
	cout << "NO";
}


#include<cstdio>
#include<algorithm>
int	main(void)
{
	long	n,m,i,A[100000],B[100000];
	if(scanf("%ld%ld%*s",&n,&m),n>m){puts("YES");return	0;}
	for(i=n;i;scanf("%ld",--i+A));
	for(std::sort(A,n+A);m^i;scanf("%ld",B+i++));
	for(std::sort(B,m+B);n--&&A[n]<=B[--m];);
	puts(~n?"YES":"NO");
	return	0;
}


#include<vector>
#include<iterator>
#include<algorithm>
#include<iostream>
using	namespace	std;
int	main(void)
{
	long	n,m,z;cin>>n>>m>>z;
	vector<long>X,Y,A,B;X.resize(n),Y.resize(m);
	vector<long>::iterator	p=X.begin(),q=Y.begin();
	for(;X.end()!=p;++p)	cin>>*p;sort(X.begin(),p);
	for(;Y.end()!=q;++q)	cin>>*q;sort(Y.begin(),q);
	set_difference(X.begin(),p,Y.begin(),q,back_inserter(A));
	set_difference(Y.begin(),q,X.begin(),p,back_inserter(B));
	bool	f=n<=m;
	if(f)	for(p=A.end(),q=B.end();A.begin()!=p&&(f=*--p<=*--q););
	cout<<(f?"NO":"YES");
	return	0;
}


#include<vector>
#include<iterator>
#include<algorithm>
#include<iostream>
using	namespace	std;
int	main(void)
{
	long	n,m,z;
	if(cin>>n>>m,n>m){cout<<"YES";return	0;}
	vector<long>A,B;A.resize(n),B.resize(m);
	vector<long>::iterator	p=A.begin(),q=B.begin();
	for(cin>>z;A.end()!=p;++p)	cin>>*p;;
	for(sort(A.begin(),p);B.end()!=q;++q)	cin>>*q;
	for(sort(B.begin(),q);A.begin()!=p--&&*p<=*--q;);
	cout<<(A.begin()>p?"NO":"YES");
	return	0;
}


#include<cstdio>
#include<algorithm>
int	main(void)
{
	long	n,m,i,A[100000],B[100000];
	if(scanf("%ld%ld",&n,&m),n>m){puts("YES");return	0;}
	for(scanf("%*s"),i=n;i;scanf("%ld",--i+A));
	for(std::sort(A,n+A);m^i;scanf("%ld",B+i++));
	for(std::sort(B,m+B);n--&&A[n]<=B[--m];);
	puts(~n?"YES":"NO");
	return	0;
}


#include <iostream>
#include <string>
#include <unordered_map>
#include <algorithm>

using namespace std;

int main()
{
	//freopen("test.in","r",stdin);freopen("test.out","w",stdout);
	ios :: sync_with_stdio(false);
	int n, m, k;
	int K = 0;
	cin >> n >> m >> k;
	vector< pair<int,int> > fish(n + m);
	static vector<int> fishCount[2];
	fishCount[0] = fishCount[1] = vector<int>(int(2e5) + 5,0);
	unordered_map<int,int> hash;
	for (int i = 0;i < n + m;i++) {
		cin >> fish[i].first;
		fish[i].second = i >= n;
	}

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

	for (int i = 0;i < n + m;i++) {
		unordered_map<int,int>::iterator it = hash.find(fish[i].first);
		if (it != hash.end()) {
			fishCount[fish[i].second][it -> second]++;
		} else {
			hash[fish[i].first] = ++K;
			fishCount[fish[i].second][K]++;
		}
	}

	int aliceFish = 0;
	for (int i = 1;i <= K;i++) {
		aliceFish += fishCount[0][i];
		if (fishCount[1][i] > 0) {
			aliceFish = max(0,aliceFish - fishCount[1][i]);
		}
	}

	if (aliceFish) {
		cout << "YES\n";
	} else {
		cout << "NO\n";
	}
    return 0;
}


#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<map>
#include<set>
#include<string>
#include<vector>
#include<assert.h>
#define pb push_back
#define rep(i,j,k) for(int i=(j);i<=(int)k;i++)
#define per(i,j,k) for(int i=(j);i>=(int)k;i--)
#define lowbit(x) ((x)&(-(x)))
#define fi first
#define se second
#define pii pair<int,int>
#define VI vector<int>
#define S(x) x.size()
using namespace std;
typedef long long LL;
typedef double db;
int tot=1;
const int N=110000;
int ma[N*35];int tag[N*35];
int cl[N*35],cr[N*35];
int n,m,k;
void add(int &me,int l,int r,int x,int y,int v){
	if(!me)me=++tot;
	if(x<=l&&r<=y){
		tag[me]+=v;
		return;
	}
	int mid=(l+r)>>1;
	if(x<=mid)add(cl[me],l,mid,x,y,v);
	if(y>mid)add(cr[me],mid+1,r,x,y,v);
	ma[me]=max(ma[cl[me]]+tag[cl[me]],ma[cr[me]]+tag[cr[me]]);
}
int main(){
	scanf("%d%d%d",&n,&m,&k);int rt=1;
	rep(i,1,n){
		int v;scanf("%d",&v);
		add(rt,1,k,1,v,1);
	}
	rep(i,1,m){
		int v;scanf("%d",&v);
		add(rt,1,k,1,v,-1);
	}
	if(ma[1]+tag[1]>0){
		printf("YES");
	}
	else printf("NO");
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<set>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<bitset>
#include<iomanip>
#include<iostream>
#include<cmath>
using namespace std;

#define rep(i,x,y) for(i=x;i<=y;i++)
#define _rep(i,x,y) for(i=x;i>=y;i--)
#define CL(S,x) memset(S,x,sizeof(S))
#define CP(S1,S2) memcpy(S1,S2,sizeof(S2))
#define ALL(x,S) for(x=S.begin();x!=S.end();x++)
#define sqr(x) ((x)*(x))
#define mp make_pair
#define fi first
#define se second
#define upmin(x,y) x=min(x,y)
#define upmax(x,y) x=max(x,y)
#define pb push_back
#define COUT(S,x) cout<<fixed<<setprecision(x)<<S<<endl

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

template<class T> inline void read(T&x){bool fu=0;char c;for(c=getchar();c<=32;c=getchar());if(c=='-')fu=1,c=getchar();for(x=0;c>32;c=getchar())x=x*10+c-'0';if(fu)x=-x;};
inline char getc(){char c;for(c=getchar();c<=32;c=getchar());return c;}

const int N=1000010;
int n,m,i,j,k,l,p,x;
int a[N],b[N];

int main()
{
    //freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	read(n);read(m);read(k);
	rep(i,1,n)read(a[i]);
	rep(i,1,m)read(b[i]);
	sort(a+1,a+1+n);
	sort(b+1,b+1+n);
	rep(i,1,n)if(a[i]>b[i]){printf("YES\n");return 0;}
	if(n>m){printf("YES\n");return 0;}
	else{printf("NO\n");return 0;}

    scanf("\n");
    return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<set>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<bitset>
#include<iomanip>
#include<iostream>
#include<cmath>
using namespace std;

#define rep(i,x,y) for(i=x;i<=y;i++)
#define _rep(i,x,y) for(i=x;i>=y;i--)
#define CL(S,x) memset(S,x,sizeof(S))
#define CP(S1,S2) memcpy(S1,S2,sizeof(S2))
#define ALL(x,S) for(x=S.begin();x!=S.end();x++)
#define sqr(x) ((x)*(x))
#define mp make_pair
#define fi first
#define se second
#define upmin(x,y) x=min(x,y)
#define upmax(x,y) x=max(x,y)
#define pb push_back
#define COUT(S,x) cout<<fixed<<setprecision(x)<<S<<endl

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

template<class T> inline void read(T&x){bool fu=0;char c;for(c=getchar();c<=32;c=getchar());if(c=='-')fu=1,c=getchar();for(x=0;c>32;c=getchar())x=x*10+c-'0';if(fu)x=-x;};
inline char getc(){char c;for(c=getchar();c<=32;c=getchar());return c;}

const int N=1000010;
int n,m,i,j,k,l,p,x;
int a[N],b[N];

int main()
{
    //freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	read(n);read(m);read(k);
	if(n<m){printf("NO\n");return 0;}
	if(n>m){printf("YES\n");return 0;}
	rep(i,1,n)read(a[i]);
	rep(i,1,m)read(b[i]);
	sort(a+1,a+1+n);
	sort(b+1,b+1+n);
	rep(i,1,n)if(a[i]>b[i]){printf("YES\n");return 0;}
	printf("NO\n");

    scanf("\n");
    return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<set>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<bitset>
#include<iomanip>
#include<iostream>
#include<cmath>
using namespace std;

#define rep(i,x,y) for(i=x;i<=y;i++)
#define _rep(i,x,y) for(i=x;i>=y;i--)
#define CL(S,x) memset(S,x,sizeof(S))
#define CP(S1,S2) memcpy(S1,S2,sizeof(S2))
#define ALL(x,S) for(x=S.begin();x!=S.end();x++)
#define sqr(x) ((x)*(x))
#define mp make_pair
#define fi first
#define se second
#define upmin(x,y) x=min(x,y)
#define upmax(x,y) x=max(x,y)
#define pb push_back
#define COUT(S,x) cout<<fixed<<setprecision(x)<<S<<endl

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

template<class T> inline void read(T&x){bool fu=0;char c;for(c=getchar();c<=32;c=getchar());if(c=='-')fu=1,c=getchar();for(x=0;c>32;c=getchar())x=x*10+c-'0';if(fu)x=-x;};
inline char getc(){char c;for(c=getchar();c<=32;c=getchar());return c;}

const int N=1000010;
int n,m,i,j,k,l,p,x,a[N],b[N];
multiset<int> S1,S2;
set<int> G;
set<int>::iterator it;
multiset<int>::iterator pos;

int main()
{
	read(n);read(m);read(k);
	rep(i,1,n)read(x),S1.insert(x),G.insert(x);
	rep(i,1,m)read(x),S2.insert(x),G.insert(x);
	ALL(it,G)
	{
		int t=*it;
		while(S1.find(t)!=S1.end()&&S2.find(t)!=S2.end())
		S1.erase(S1.find(t)),S2.erase(S2.find(t));
	}
	n=m=0;
	ALL(pos,S1)a[++n]=*pos;
	ALL(pos,S2)b[++m]=*pos;

	j=1;
	rep(i,1,m)
	{
		for(;j<=n&&b[j]<a[i];j++);
		if(j>n){printf("NO\n");return 0;}
	}
	printf("YES\n");return 0;

    scanf("\n");
    return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<set>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<bitset>
#include<iomanip>
#include<iostream>
#include<cmath>
using namespace std;

#define rep(i,x,y) for(i=x;i<=y;i++)
#define _rep(i,x,y) for(i=x;i>=y;i--)
#define CL(S,x) memset(S,x,sizeof(S))
#define CP(S1,S2) memcpy(S1,S2,sizeof(S2))
#define ALL(x,S) for(x=S.begin();x!=S.end();x++)
#define sqr(x) ((x)*(x))
#define mp make_pair
#define fi first
#define se second
#define upmin(x,y) x=min(x,y)
#define upmax(x,y) x=max(x,y)
#define pb push_back
#define COUT(S,x) cout<<fixed<<setprecision(x)<<S<<endl

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

template<class T> inline void read(T&x){bool fu=0;char c;for(c=getchar();c<=32;c=getchar());if(c=='-')fu=1,c=getchar();for(x=0;c>32;c=getchar())x=x*10+c-'0';if(fu)x=-x;};
inline char getc(){char c;for(c=getchar();c<=32;c=getchar());return c;}

const int N=1000010;
int n,m,i,j,k,l,p,x;
int a[N],b[N];

int main()
{
    //freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	read(n);read(m);read(k);

	if(n>m){printf("YES\n");return 0;}

	rep(i,1,n)read(a[i]);
	rep(i,1,m)read(b[i]);
	sort(a+1,a+1+n,greater<int>());
	sort(b+1,b+1+m,greater<int>());
	rep(i,1,n)if(a[i]>b[i]){printf("YES\n");return 0;}
	printf("NO\n");

    scanf("\n");
    return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<set>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<bitset>
#include<iomanip>
#include<iostream>
#include<cmath>
using namespace std;

#define rep(i,x,y) for(i=x;i<=y;i++)
#define _rep(i,x,y) for(i=x;i>=y;i--)
#define CL(S,x) memset(S,x,sizeof(S))
#define CP(S1,S2) memcpy(S1,S2,sizeof(S2))
#define ALL(x,S) for(x=S.begin();x!=S.end();x++)
#define sqr(x) ((x)*(x))
#define mp make_pair
#define fi first
#define se second
#define upmin(x,y) x=min(x,y)
#define upmax(x,y) x=max(x,y)
#define pb push_back
#define COUT(S,x) cout<<fixed<<setprecision(x)<<S<<endl

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

template<class T> inline void read(T&x){bool fu=0;char c;for(c=getchar();c<=32;c=getchar());if(c=='-')fu=1,c=getchar();for(x=0;c>32;c=getchar())x=x*10+c-'0';if(fu)x=-x;};
inline char getc(){char c;for(c=getchar();c<=32;c=getchar());return c;}

const int N=1000010;
int n,m,i,j,k,l,p,x;
int a[N],b[N];

int main()
{
    //freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	read(n);read(m);read(k);

	if(n>m){printf("YES\n");return 0;}

	rep(i,1,n)read(a[i]);
	rep(i,1,m)read(b[i]);
	sort(a+1,a+1+n,greater<int>());
	sort(b+1,b+1+n,greater<int>());
	rep(i,1,n)if(a[i]>b[i]){printf("YES\n");return 0;}
	printf("NO\n");

    scanf("\n");
    return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<set>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<bitset>
#include<iomanip>
#include<iostream>
#include<cmath>
using namespace std;

#define rep(i,x,y) for(i=x;i<=y;i++)
#define _rep(i,x,y) for(i=x;i>=y;i--)
#define CL(S,x) memset(S,x,sizeof(S))
#define CP(S1,S2) memcpy(S1,S2,sizeof(S2))
#define ALL(x,S) for(x=S.begin();x!=S.end();x++)
#define sqr(x) ((x)*(x))
#define mp make_pair
#define fi first
#define se second
#define upmin(x,y) x=min(x,y)
#define upmax(x,y) x=max(x,y)
#define pb push_back
#define COUT(S,x) cout<<fixed<<setprecision(x)<<S<<endl

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

template<class T> inline void read(T&x){bool fu=0;char c;for(c=getchar();c<=32;c=getchar());if(c=='-')fu=1,c=getchar();for(x=0;c>32;c=getchar())x=x*10+c-'0';if(fu)x=-x;};
inline char getc(){char c;for(c=getchar();c<=32;c=getchar());return c;}

const int N=1000010;
int n,m,i,j,k,l,p,x,a[N],b[N];
multiset<int> S1,S2;
set<int> G;
set<int>::iterator it;
multiset<int>::iterator pos;

int main()
{
    //freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	read(n);read(m);read(k);
	rep(i,1,n)read(x),S1.insert(x),G.insert(x);
	rep(i,1,m)read(x),S2.insert(x),G.insert(x);
	ALL(it,G)
	{
		int t=*it;
		while(S1.find(t)!=S1.end()&&S2.find(t)!=S2.end())
		S1.erase(S1.find(t)),S2.erase(S2.find(t));
	}
	n=m=0;
	ALL(pos,S1)a[++n]=*pos;
	ALL(pos,S2)b[++m]=*pos;

	j=1;
	rep(i,1,n)
	{
		for(;j<=m&&b[j]<a[i];j++);
		if(j>m){printf("YES\n");return 0;}
	}
	printf("NO\n");return 0;

    scanf("\n");
    return 0;
}


#include <iostream>
#include <map>
#include <algorithm>
using namespace std;

#define rep(i,n) for (int i = 0; i < int(n); ++i)

int n,m,k,c;
map<int,int> seq;

int main() {
	cin >> n >> m >> k;
	rep (i,n) cin >> k, seq[k]++;
	rep (i,m) cin >> k, seq[k]--;

	for (auto& p : seq) {
		c += p.second;
		if (c > 0) {
			cout << "YES" << endl;
			return 0;
		}
	}
	cout << "NO" << endl;
}


#include <iostream>
#include <map>
#include <algorithm>
using namespace std;

#define rep(i,n) for (int i = 0; i < int(n); ++i)

int n,m,k,c;
map<int,int,greater<int>> seq;

int main() {
	cin >> n >> m >> k;
	rep (i,n) cin >> k, seq[k]++;
	rep (i,m) cin >> k, seq[k]--;

	for (auto& p : seq) {
		c += p.second;
		if (c > 0) {
			cout << "YES" << endl;
			return 0;
		}
	}
	cout << "NO" << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

#define rep(i,n) for (int i = 0; i < n; ++i)

struct Pair {
	int kind,value;
};

bool comp(Pair p, Pair q) {
	return p.kind > q.kind;
}

vector<Pair> v;
int n,m,k,kind,c = 0;

int main() {
	cin >> n >> m >> k;
	rep (i,n) cin >> kind, v.push_back({ kind, 1 });
	rep (i,m) cin >> kind, v.push_back({ kind, -1 });
	sort(v.begin(), v.end(), comp);
	for (Pair& p : v) {
		c += p.value;
		if (c > 0) {
			cout << "YES" << endl;
			return 0;
		}
	}
	cout << "NO" << endl;
}


#include <iostream>
#include <algorithm>
using namespace std;

int n, m, k;
int *A, *B;

bool majorizes()
{
    if(n>m) return false;

    int aIt=n-1;
    for(int i=m-1; i>=0; i--)
    {
        if(B[i]>=A[aIt]) aIt--;
        if(aIt<0) break;
    }
    return aIt<0;
}

int main()
{
    cin >> n >> m >> k;

    A=new int[n];
    for(int i=0; i<n; i++) cin >> A[i];

    B=new int[m];
    for(int i=0; i<m; i++) cin >> B[i];

    sort(A, A+n);
    sort(B, B+m);

    if(majorizes()) cout << "NO";
    else cout << "YES";

    delete[] A, B;
    return 0;
}


#include <limits.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <limits>
#include <cassert>
#include <string>
#include <vector>
#include <deque>
#include <fstream>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <queue>
#include <iterator>
#include <set>
static const int INF = std::numeric_limits<int>::max();

int main()
{
  int n, m, k;
  std::cin >> n >> m >> k;
  std::vector<std::pair<int, int> > v;
  for(int i = 0; i < n; ++i) {
    int a;
    std::cin >> a;
    v.push_back(std::make_pair(a, 0));
  }
  for(int i = 0; i < m; ++i) {
    int a;
    std::cin >> a;
    v.push_back(std::make_pair(a, 1));
  }
  std::sort(v.begin(), v.end());
  int i = 0;
  int N = n+m;
  int res = -1;
  for(; i < N;) {
    int j;
    for(j = i; j < N && v[j].second == 0; ++j);
    int an = j-i;
    i = j;
    for(; j < N && v[j].second == 1; ++j);
    int bn = j-i;
    if(an < bn) {
      res = -1;
    } else if(an > bn) {
      res = 1;
    }
    i = j;
  }
  if(res == 1) {
    std::cout << "YES" << std::endl;
  } else {
    std::cout << "NO" << std::endl;
  }
}


#include <limits.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <limits>
#include <cassert>
#include <string>
#include <vector>
#include <deque>
#include <fstream>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <queue>
#include <iterator>
#include <set>
static const int INF = std::numeric_limits<int>::max();

int main()
{
  int n, m, k;
  std::cin >> n >> m >> k;
  std::vector<std::pair<int, int> > v;
  for(int i = 0; i < n; ++i) {
    int a;
    std::cin >> a;
    v.push_back(std::make_pair(a, 0));
  }
  for(int i = 0; i < m; ++i) {
    int a;
    std::cin >> a;
    v.push_back(std::make_pair(a, 1));
  }
  std::sort(v.begin(), v.end());
  int i = 0;
  int N = n+m;
  int res = -1;
  for(; i < N;) {
    int j;
    for(j = i; j < N && v[j].second == 0; ++j);
    int an = j-i;
    i = j;
    for(; j < N && v[j].second == 1; ++j);
    int bn = j-i;
    if(an < bn) {
      res = -1;
    } else if(an > bn) {
      res = 1;
      break;
    }
    i = j;
  }
  if(res == 1) {
    std::cout << "YES" << std::endl;
  } else {
    std::cout << "NO" << std::endl;
  }
}


#include <limits.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <limits>
#include <cassert>
#include <string>
#include <vector>
#include <deque>
#include <fstream>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <queue>
#include <iterator>
#include <set>
static const int INF = std::numeric_limits<int>::max();

int main()
{
  int n, m, k;
  std::cin >> n >> m >> k;
  std::vector<int> a(n), b(m);
  for(int i = 0; i < n; ++i) {
    std::cin >> a[i];
  }
  for(int i = 0; i < m; ++i) {
    std::cin >> b[i];
  }
  if(n > m) {
    std::cout << "YES" << std::endl;
    return 0;
  }
  std::sort(a.begin(), a.end());
  std::sort(b.begin(), b.end());
  int boff = m-n;
  for(int i = 0; i < n; ++i) {
    if(a[i] > b[i+boff]) {
      std::cout << "YES" << std::endl;
      return 0;
    }
  }
  std::cout << "NO" << std::endl;
}


#include <bits/stdc++.h>
using namespace std;
#define debug(x) cout << #x << " = " << x << endl;
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define rrep(i,b,a) for(int i = (b); i >= (a); --i)
#define clr(a,x) memset(a,(x),sizeof(a))
#define LL long long
#define eps 1e-7
#define mt make_tuple
#define eb emplace_back
const int maxn = 200000 + 5;

int n,m;

int main()
{
//    Getinput(); return 0;
    #ifdef ACM
        freopen("in.txt","r",stdin);
        //freopen("out1.txt","w",stdout);
    #endif // ACM
    cin >> n >> m;
    scanf("%*d");
    priority_queue<int> qa,qb;
    rep(i,0,n) {
        int x; scanf("%d",&x);
        qa.push(x);
    }
    rep(i,0,m) {
        int x; scanf("%d",&x);
        qb.push(x);
    }
    bool ok = false;
    while (qa.size() && qb.size()) {
        int a = qa.top(), b = qb.top();
        qa.pop(); qb.pop();
        if (a > b) { ok = true; break; }
    }
    puts(ok ? "YES" : "NO");
}


#include <bits/stdc++.h>
using namespace std;
#define debug(x) cout << #x << " = " << x << endl;
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define rrep(i,b,a) for(int i = (b); i >= (a); --i)
#define clr(a,x) memset(a,(x),sizeof(a))
#define LL long long
#define eps 1e-7
#define mt make_tuple
#define eb emplace_back
const int maxn = 200000 + 5;

int n,m;

int main()
{
//    Getinput(); return 0;
    #ifdef ACM
        freopen("in.txt","r",stdin);
        //freopen("out1.txt","w",stdout);
    #endif // ACM
    cin >> n >> m;
    scanf("%*d");
    priority_queue<int> qa,qb;
    rep(i,0,n) {
        int x; scanf("%d",&x);
        qa.push(x);
    }
    rep(i,0,m) {
        int x; scanf("%d",&x);
        qb.push(x);
    }
    bool ok = false;
    while (qa.size() && qb.size()) {
        int a = qa.top(), b = qb.top();
        qa.pop(); qb.pop();
        if (a > b) { ok = true; break; }
    }
    if (qb.size() == 0 && qa.size() > 0) ok = true;
    puts(ok ? "YES" : "NO");
}