#include <bits/stdc++.h>
using namespace std;
set<int> s;
map<long long, int> m1, m2;
int main() {
  int n, n2, k;
  cin >> n >> n2 >> k;
  for (int i = 0; i < n; i++) {
    int q;
    cin >> q;
    m1[q]++;
    s.insert(q);
  }
  for (int i = 0; i < n2; i++) {
    int q;
    cin >> q;
    m2[q]++;
    s.insert(q);
  }
  vector<int> difs;
  while (!s.empty()) {
    int q = *s.begin();
    difs.push_back(m1[q] - m2[q]);
    s.erase(s.begin());
  }
  int sum = 0;
  for (int i = difs.size() - 1; i >= 0; i--) {
    sum += difs[i];
    if (sum > 0) return 0 * bool(cout << "YES" << endl);
  }
  cout << "NO" << endl;
}
