#include <bits/stdc++.h>
using namespace std;
int n, m, k, arr1[100010], arr2[100010];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < n; i++) scanf("%d", &arr1[i]);
  for (int i = 0; i < m; i++) scanf("%d", &arr2[i]);
  sort(arr1, arr1 + n);
  sort(arr2, arr2 + m);
  for (int i = n - 1, j = m - 1; i >= 0 && j >= 0; i--, j--) {
    if (arr1[i] > arr2[j]) {
      printf("YES");
      return 0;
    }
  }
  if (m >= n)
    printf("NO");
  else
    printf("YES");
  return 0;
}
