#include <bits/stdc++.h>
using namespace std;
const int N = 100009;
int a[N], b[N];
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &b[i]);
  }
  sort(a, a + n);
  sort(b, b + m);
  bool ok = false;
  for (int i = n - 1, j = m - 1; i >= 0 && j >= 0; i--, j--) {
    if (a[i] > b[j]) {
      ok = true;
      break;
    } else if (j == 0 && i != 0) {
      ok = true;
      break;
    } else if (i == 0) {
      ok = false;
      break;
    }
  }
  if (ok)
    puts("YES");
  else
    puts("NO");
  return 0;
}
