#include <bits/stdc++.h>
int n, m, k, o, oo;
typedef int IA[200005];
IA a, b, c, d, sc, sd;
void qsort(int l, int r) {
  int i = l, j = r, mm, v;
  int swap;
  v = rand() % (j - i + 1) + i;
  mm = a[v];
  while (i <= j) {
    while (a[i] < mm) i++;
    while (a[j] > mm) j--;
    if (i <= j) {
      swap = a[i];
      a[i] = a[j];
      a[j] = swap;
      swap = b[i];
      b[i] = b[j];
      b[j] = swap;
      i++;
      j--;
    }
  }
  if (i < r) qsort(i, r);
  if (l < j) qsort(l, j);
}
int main() {
  int i, x;
  scanf("%d%d%d", &n, &m, &k);
  o = 0;
  for (i = 1; i <= n; i++) {
    scanf("%d", &x);
    b[o] = 0;
    a[o++] = x;
  }
  for (i = 1; i <= m; i++) {
    scanf("%d", &x);
    b[o] = 1;
    a[o++] = x;
  }
  qsort(0, o - 1);
  oo = 0;
  i = 0;
  while (i < o) {
    if (i)
      if (a[i] != a[i - 1]) oo++;
    if (b[i] == 0)
      c[oo]++;
    else
      d[oo]++;
    i++;
  }
  for (i = oo; i >= 0; i--) {
    sc[i] = sc[i + 1] + c[i];
    sd[i] = sd[i + 1] + d[i];
    if (sc[i] > sd[i]) {
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
