#include <bits/stdc++.h>
using namespace std;
map<int, int> a, b;
int main() {
  int n, m, k, v;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &v);
    if (a.count(v) == 0) a[v] = 0;
    a[v]++;
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &v);
    if (b.count(v) == 0) b[v] = 0;
    b[v]++;
  }
  map<int, int>::reverse_iterator ait;
  map<int, int>::iterator it, it1;
  bool ok = false;
  for (ait = a.rbegin(); ait != a.rend() && !ok; ait++) {
    it = b.lower_bound(ait->first);
    int sum = 0;
    for (; it != b.end();) {
      sum += it->second;
      it1 = it;
      it1++;
      b.erase(it);
      it = it1;
    }
    if (sum < ait->second) {
      ok = true;
    } else if (sum > ait->second) {
      b[ait->first] = sum - ait->second;
    }
  }
  if (ok)
    printf("YES\n");
  else
    printf("NO\n");
}
