#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  map<int, int> alice;
  map<int, int> bob;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    alice[x]++;
  }
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    alice[x]--;
  }
  long long count = 0;
  for (map<int, int>::reverse_iterator it = alice.rbegin(); it != alice.rend();
       it++) {
    count += it->second;
    if (count > 0) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}
