#include <bits/stdc++.h>
int A[100000];
int B[100000];
int compare(const void* a, const void* b) { return *(int*)b - *(int*)a; }
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < n; i++) scanf("%d", A + i);
  for (int i = 0; i < m; i++) scanf("%d", B + i);
  qsort(A, n, sizeof(A[0]), compare);
  qsort(B, m, sizeof(B[0]), compare);
  for (int i = 0; i < n; i++) {
    if (A[i] > B[i]) {
      printf("YES");
      return 0;
    }
  }
  printf("NO");
  return 0;
}
