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