#include <bits/stdc++.h>
using namespace std;
int a[int(1e5) + 10], b[int(1e5)];
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 j = 0; j < m; j++) scanf("%d", &b[j]);
  sort(a, a + n);
  sort(b, b + m);
  if (a[n - 1] > b[m - 1]) {
    printf("YES");
    return 0;
  }
  int i = n - 1;
  int j = m - 1;
  while (i > -1 && j > -1) {
    if (a[i] > b[j]) {
      printf("YES");
      return 0;
    }
    i--;
    j--;
  }
  if (i < 0)
    printf("NO");
  else
    printf("YES");
  return 0;
}
