#include <bits/stdc++.h>
const int MAXN = 100010;
int a[MAXN], b[MAXN];
int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }
int main() {
  int n, m, k;
  while (~scanf("%d%d%d", &n, &m, &k)) {
    for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
    for (int i = 1; i <= m; ++i) scanf("%d", &b[i]);
    qsort(a, n + 1, sizeof(int), cmp);
    qsort(b, m + 1, sizeof(int), cmp);
    int x = 0, y = 0;
    int i = n, j = m;
    while (i >= 0 && j >= 0) {
      if (a[i] > b[j]) {
        ++x;
        --i;
      } else if (b[j] > a[i]) {
        ++y;
        --j;
      } else {
        --i;
        --j;
      }
      if (x > y) {
        puts("YES");
        return 0;
      }
    }
    puts("NO");
  }
  return 0;
}
