#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> va;
  vector<int> vb;
  int n, m, k, bil;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    cin >> bil;
    va.push_back(bil);
  }
  for (int i = 1; i <= m; i++) {
    cin >> bil;
    vb.push_back(bil);
  }
  sort(va.begin(), va.end());
  sort(vb.begin(), vb.end());
  if (n > m) {
    cout << "YES" << endl;
    return 0;
  }
  while (!va.empty()) {
    int x = va.back();
    int y = vb.back();
    if (x > y) {
      cout << "YES" << endl;
      return 0;
    }
    va.pop_back();
    vb.pop_back();
  }
  cout << "NO" << endl;
}
