#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> ar1(n);
  for (int &x : ar1) cin >> x;
  vector<int> ar2(m);
  for (int &x : ar2) cin >> x;
  if (n > m) {
    cout << "YES";
    return 0;
  }
  sort(ar1.begin(), ar1.end());
  sort(ar2.begin(), ar2.end());
  if (*max_element(ar1.begin(), ar1.end()) >
      *max_element(ar2.begin(), ar2.end())) {
    cout << "YES";
    return 0;
  }
  int p1 = 0, p2 = 0;
  for (p2 = 0; p2 < m; p2++) {
    if (ar2[p2] >= ar1[p1]) p1++;
    if (p1 >= n) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
