#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
vector<pair<long long, int> > v;
bool cmp(pair<long long, int> p1, pair<long long, int> p2) {
  if (p1.first != p2.first) return p1.first > p2.first;
  return p1.second > p2.second;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  long long k;
  cin >> n >> m >> k;
  map<long long, int> pos, neg;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    pos[x]++;
  }
  for (int i = 0; i < m; i++) {
    long long x;
    cin >> x;
    neg[x]++;
  }
  for (map<long long, int>::iterator it = pos.begin(); it != pos.end(); it++) {
    long long minn = min(pos[it->first], neg[it->first]);
    pos[it->first] -= minn;
    neg[it->first] -= minn;
  }
  for (map<long long, int>::iterator it = pos.begin(); it != pos.end(); it++) {
    if (it->second == 0) continue;
    for (int j = 0; j < it->second; j++) {
      v.push_back(make_pair(it->first, 2));
    }
  }
  for (map<long long, int>::iterator it = neg.begin(); it != neg.end(); it++) {
    if (it->second == 0) continue;
    for (int j = 0; j < it->second; j++) {
      v.push_back(make_pair(it->first, 1));
    }
  }
  sort(v.begin(), v.end(), cmp);
  int cnt_neg = 0;
  for (int i = 0; i < v.size(); i++) {
    if (v[i].second == 1)
      cnt_neg++;
    else
      cnt_neg--;
    if (cnt_neg < 0) {
      break;
    }
  }
  if (cnt_neg < 0) {
    cout << "YES\n";
  } else
    cout << "NO\n";
  return 0;
}
