#include <bits/stdc++.h>
using namespace std;
int b_search(vector<pair<int, int>> &a, int key) {
  int lo = 0, hi = a.size() - 1;
  while (lo < hi) {
    int mid = lo + (hi - lo) / 2;
    if (a[mid].first < key)
      lo = mid + 1;
    else
      hi = mid;
  }
  if (a[lo].first >= key) return a[lo].second;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, k, x;
  cin >> n >> m >> k;
  map<int, int> np;
  for (int i = 0; i < n; i++) cin >> x, np[x]++;
  vector<pair<int, int>> a, b;
  for (auto v : np) a.push_back({v.first, v.second});
  np.clear();
  for (int i = 0; i < m; i++) cin >> x, np[x]++;
  for (auto v : np) b.push_back({v.first, v.second});
  int pre = 0;
  for (int i = a.size() - 1; i >= 0; i--)
    a[i].second = a[i].second + pre, pre = a[i].second;
  pre = 0;
  for (int i = b.size() - 1; i >= 0; i--)
    b[i].second = b[i].second + pre, pre = b[i].second;
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  for (int i = a.size() - 1; i >= 0; i--) {
    int p = a[i].second;
    int q = b_search(b, a[i].first);
    if (p > q) {
      cout << "YES\n";
      return 0;
    }
  }
  cout << "NO\n";
}
