#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  long long i, n, m, k;
  cin >> n >> m >> k;
  multiset<long long> s1, s2;
  for (i = 0; i < n; i++) {
    long long x;
    cin >> x;
    s1.insert(x);
  }
  for (i = 0; i < m; i++) {
    long long x;
    cin >> x;
    s2.insert(x);
  }
  for (auto i : s1) {
    if (s2.lower_bound(i) == s2.end()) {
      cout << "YES";
      return 0;
    }
    long long x = *s2.lower_bound(i);
    s2.erase(s2.find(x));
  }
  cout << "NO";
}
