#include <bits/stdc++.h>
using namespace std;
bool cmp(int x, int y) { return x > y; }
int a[200005], b[200005];
int main() {
  int i, j, m, n, s, w, k;
  while (~scanf("%d %d %d", &n, &m, &k)) {
    for (i = 0; i < n; i++) scanf("%d", &a[i]);
    for (j = 0; j < m; j++) scanf("%d", &b[j]);
    sort(a, a + n, cmp);
    sort(b, b + m, cmp);
    int v = 0;
    for (i = 0; i < n && i < m; i++) {
      if (a[i] > b[i]) {
        v = 1;
        break;
      }
    }
    if (v == 0 && n > m) v = 1;
    if (v == 1)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
