#include <bits/stdc++.h>
using namespace std;
template <class T>
inline string tostr(T &a) {
  ostringstream s;
  s << a;
  return s.str();
}
template <class T>
inline int toint(T a) {
  istringstream s(a);
  int ret;
  s >> ret;
  return ret;
}
int a[444444], b[4444444];
bool ok(int n, int m) {
  if (n > m) return false;
  for (int i = n - 1, j = m - 1; i >= 0; i--, j--)
    if (a[i] > b[j]) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, k;
  cin >> n >> m >> k;
  for (register int i = (0); i < (int)(n); ++i) cin >> a[i];
  for (register int i = (0); i < (int)(m); ++i) cin >> b[i];
  sort(a, a + n);
  sort(b, b + m);
  if (!ok(n, m))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
