#include <bits/stdc++.h>
using namespace std;
int a[105000];
int b[105000];
int n, m, k;
int main() {
  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]);
    if (n > m) {
      printf("YES\n");
      continue;
    }
    sort(a + 1, a + 1 + n);
    sort(b + 1, b + 1 + m);
    bool ok = false;
    for (int i = 1; i <= n; i++) {
      if (a[n + 1 - i] > b[m + 1 - i]) {
        ok = true;
        break;
      }
    }
    if (ok)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
