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