#include <bits/stdc++.h>
using namespace std;
template <typename T>
void chkmax(T &x, T y) {
  x = x > y ? x : y;
}
template <typename T>
void chkmin(T &x, T y) {
  x = x > y ? y : x;
}
const int INF = 2139062143;
template <typename T>
void read(T &x) {
  x = 0;
  bool f = 1;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = 0;
  } while (ch > '9' || ch < '0');
  do {
    x = x * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  x = f ? x : -x;
}
template <typename T>
void write(T x) {
  if (x < 0) x = ~x + 1, putchar('-');
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
const int N = 1e5 + 7;
int n, m, k;
map<int, int> mp;
int main() {
  read(n);
  read(m);
  read(k);
  bool flag = false;
  int p = 0;
  for (int i = 1, x; i <= n; i++) read(x), mp[-x]++;
  for (int i = 1, x; i <= m; i++) read(x), mp[-x]--;
  for (map<int, int>::iterator iter = mp.begin(); iter != mp.end(); iter++)
    p += iter->second, flag |= p > 0;
  if (flag)
    puts("YES");
  else
    puts("NO");
  return 0;
}
