#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> v1, v2;
  int i, j;
  for (i = 0; i < n; i++) {
    int t;
    cin >> t;
    v1.push_back(t);
  }
  for (i = 0; i < m; i++) {
    int t;
    cin >> t;
    v2.push_back(t);
  }
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  for (i = n - 1, j = m - 1; i >= 0; i--, j--) {
    if (v1[i] > v2[j]) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
