#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, k;
  while (cin >> n >> m >> k) {
    vector<int> alice(n), bob(m);
    for (int &i : alice) cin >> i;
    for (int &i : bob) cin >> i;
    sort(alice.begin(), alice.end());
    sort(bob.begin(), bob.end());
    if (n > m)
      cout << "YES" << endl;
    else {
      int start = m - n;
      bool ok = false;
      for (int i = 0; i < n; i++) {
        if (alice[i] > bob[start + i]) {
          ok = true;
          break;
        }
      }
      cout << (ok ? "YES" : "NO") << endl;
    }
  }
  return 0;
}
