#include <bits/stdc++.h>
using namespace std;
int m, n, k;
int mas1[100005], mas2[100005];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < n; ++i) scanf("%d", &mas1[i]);
  for (int i = 0; i < m; ++i) scanf("%d", &mas2[i]);
  sort(mas1, mas1 + n);
  sort(mas2, mas2 + m);
  reverse(mas1, mas1 + n);
  reverse(mas2, mas2 + m);
  int pt1 = 0, pt2 = 0;
  int q1 = 1, q2 = 0;
  for (int i = 0; i < n; ++i) {
    if (i < n - 1 && mas1[i] == mas1[i + 1]) {
      ++q1;
      continue;
    }
    while (mas2[pt2] >= mas1[i]) ++pt2, ++q2;
    if (q1 > q2) {
      printf("YES\n");
      return 0;
    }
    q2 -= q1;
    q1 = 1;
  }
  printf("NO\n");
  return 0;
}
