#include <bits/stdc++.h>
using namespace std;
const int oo = (int)1e9;
const double PI = 2 * acos(0.0);
const double eps = 1e-9;
int n1, n2, k, x, nums1[100009], nums2[100009];
int main() {
  scanf("%d%d%d", &n1, &n2, &k);
  if (n1 > n2) {
    cout << "YES" << endl;
    return 0;
  }
  for (int i = 0; i < (int)(n1); i++) scanf("%d", &nums1[i]);
  for (int i = 0; i < (int)(n2); i++) scanf("%d", &nums2[i]);
  sort(nums1, nums1 + n1);
  reverse(nums1, nums1 + n1);
  sort(nums2, nums2 + n2);
  reverse(nums2, nums2 + n2);
  for (int i = 0; i < (int)(n1); i++)
    if (nums1[i] > nums2[i]) {
      cout << "YES" << endl;
      return 0;
    }
  cout << "NO" << endl;
  return 0;
}
