#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, K;
  scanf("%d %d %d", &N, &M, &K);
  map<int, int> a, b;
  for (int i = 0, t = 0; i < N; i++) scanf("%d", &t), a[t] += 1;
  for (int i = 0, t = 0; i < M; i++) scanf("%d", &t), b[t] += 1;
  map<int, int>::iterator ita = a.end(), itb = b.end();
  ita--;
  itb--;
  if (ita->first > itb->first ||
      (ita->first == itb->first && ita->second > itb->second)) {
    cout << "YES" << endl;
    return 0;
  }
  int t1 = 0, t2 = 0;
  bool b1 = true;
  while (t1 <= t2) {
    t1 += ita->second;
    while (itb->first >= ita->first && b1) {
      t2 += itb->second;
      if (itb == b.begin()) {
        b1 = false;
        break;
      }
      itb--;
    }
    if (ita == a.begin()) break;
    ita--;
  }
  if (t1 > t2)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
