#include <bits/stdc++.h>
using namespace std;
template <class T>
void debug(T a, T b) {
  for (; a != b; a++) cerr << *a << ' ';
  cerr << endl;
}
template <class T>
bool isprime(T x) {
  int till = (T)sqrt(x + .0);
  if (x <= 1) return 0;
  if (x == 2) return 1;
  if (x % 2 == 0) return 0;
  for (int i = 3; i <= till; i += 2)
    if (x % i == 0) return 0;
  return 1;
}
int n, m;
int k;
int a[100000];
int b[100000];
vector<int> newa;
vector<int> newb;
vector<int> newc;
int main() {
  cin >> n >> m;
  cin >> k;
  for (int i = 0; i < int(n); i++) cin >> a[i];
  for (int i = 0; i < int(m); i++) cin >> b[i];
  sort(a, a + n);
  sort(b, b + m);
  newa.reserve(100000);
  newb.reserve(100000);
  newc.reserve(200000);
  for (int i = 0, j = 0; i < n || j < m;) {
    if (i < n && j < m) {
      if (a[i] < b[j]) {
        newc.push_back(a[i]);
        newa.push_back(a[i]);
        i++;
      } else if (a[i] > b[j]) {
        newc.push_back(b[j]);
        newb.push_back(b[j]);
        j++;
      } else {
        i++;
        j++;
      }
    } else {
      if (i < n) {
        newc.push_back(a[i]);
        newa.push_back(a[i]);
        i++;
      }
      if (j < m) {
        newc.push_back(b[j]);
        newb.push_back(b[j]);
        j++;
      }
    }
  }
  sort((newa).begin(), (newa).end());
  sort((newb).begin(), (newb).end());
  sort((newc).begin(), (newc).end());
  int cntb = 0;
  for (int i = int((int)(newc).size() - 1); i >= 0; i--) {
    if (binary_search((newb).begin(), (newb).end(), newc[i])) {
      cntb++;
    } else {
      cntb--;
    }
    if (cntb < 0) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return EXIT_SUCCESS;
}
