#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> a(n, 0), b(m, 0);
  for (auto &i : a) cin >> i;
  for (auto &i : b) cin >> i;
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  int i = 0, flag = 0;
  if (((n - i) > m) or (a[n - 1] > b[m - 1])) flag = 1;
  for (int j = 0; j < m && !flag; j++) {
    int curr = b[j];
    while (i < n && a[i] < curr) i++;
    if ((n - i) > (m - j)) flag = 1;
    while (j < m and b[j] == curr) j++;
    while (i < n && a[i] == curr) i++;
    if (n - i > (m - j)) flag = 1;
    j -= 1;
  }
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
