#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void gmin(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
inline void gmax(T &a, T b) {
  if (a < b) a = b;
}
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fll;
const double DINF = 1e10;
const double EPS = 1e-9;
const double PI = 3.14159265358979323846264338327950288;
inline int dcmp(const double &a) { return a > EPS ? 1 : (a < -EPS ? -1 : 0); }
const int MAXN = 100005;
int n, m, k;
int a[MAXN], b[MAXN];
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]);
  sort(a + 1, a + 1 + n);
  sort(b + 1, b + 1 + m);
  while (m && n && b[m] >= a[n]) m--, n--;
  if (!n)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
