#include <bits/stdc++.h>
using namespace std;
map<int, int> Map;
int main() {
  int i;
  int n, m, k;
  int v;
  cin >> n >> m >> k;
  for (i = 0; i < (n); i++) {
    cin >> v;
    Map[v]++;
  }
  for (i = 0; i < (m); i++) {
    cin >> v;
    Map[v]--;
  }
  map<int, int>::iterator it;
  vector<pair<int, int> > vp;
  for (it = Map.begin(); it != Map.end(); it++) {
    if (it->second != 0) {
      vp.push_back(make_pair(it->first, it->second));
    }
  }
  sort((vp).begin(), (vp).end());
  int pos = 0, neg = 0;
  bool f = 0, p = 0;
  for (i = ((int)(vp).size()) - 1; i >= 0; i--) {
    if (!f) {
      if (vp[i].second > 0) p = 1;
      f = 1;
    }
    if (vp[i].second > 0) {
      pos += vp[i].second;
    } else
      neg += abs(vp[i].second);
    if (pos > neg) {
      cout << "YES" << endl;
      return 0;
    }
  }
  if (neg > pos)
    cout << "NO" << endl;
  else if (p)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
