#include <bits/stdc++.h>
using namespace std;
int N, M, K;
multiset<int> A, B, C;
int main() {
  scanf("%d%d%d", &N, &M, &K);
  A.clear();
  B.clear();
  int x;
  for (int i = 0; i < N; ++i) {
    scanf("%d", &x);
    A.insert(x);
  }
  for (int i = 0; i < M; ++i) {
    scanf("%d", &x);
    B.insert(x);
  }
  for (multiset<int>::iterator it = A.begin(); it != A.end(); ++it) {
    multiset<int>::iterator tx = B.find(*it);
    if (tx != B.end()) {
      B.erase(tx);
    } else {
      C.insert(*it);
    }
  }
  bool ok = false;
  for (multiset<int>::iterator it = C.begin(); it != C.end(); ++it) {
    multiset<int>::iterator tx = B.lower_bound(*it);
    if (tx == B.end()) {
      ok = true;
      break;
    } else {
      B.erase(tx);
    }
  }
  if (ok)
    puts("YES");
  else
    puts("NO");
}
