#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool elem(set<T> st, T val) {
  return (st.find(val) != st.end());
}
template <typename T>
void printv(vector<T> vt) {
  for (int i = 0; i < (int)vt.size() - 1; ++i) cout << vt[i] << " ";
  cout << vt[vt.size() - 1] << endl;
}
map<int, int> nms;
int oca[101010];
int ocb[101010];
int main(void) {
  int n, m, k;
  const string yes = "YES";
  const string no = "NO";
  cin >> n >> m >> k;
  vector<int> a(n), b(m);
  for (int i = 0; i < (int)n; ++i) cin >> a[i];
  for (int i = 0; i < (int)m; ++i) cin >> b[i];
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  if (*(a.rbegin()) > *(b.rbegin())) {
    cout << yes << endl;
    return 0;
  }
  int cb = 0;
  string ret = no;
  for (int i = 0; i < (int)n; ++i) {
    cb = (((cb) > (0)) ? (cb) : (0));
    while (b[cb] < a[i]) cb++;
    cb--;
    if (m - cb - 1 < n - i) {
      ret = yes;
    }
  }
  cout << ret << endl;
  return 0;
}
