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