#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const long long N = 1e5 + 5, K = 105;
const int si = (1 << 20);
const long long add = 1e4;
const long long oo = (long long)1e18;
const long long M = 3e6 + 5;
const double INFdb = 1e10;
int n, m, k;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  cin >> n >> m >> k;
  vector<int> a(n);
  vector<int> b(m);
  for (int& x : a) cin >> x;
  for (int& x : b) cin >> x;
  if (n > m) return cout << "YES", 0;
  sort((a).begin(), (a).end());
  sort((b).begin(), (b).end());
  if (a.back() > b.back()) return cout << "YES", 0;
  for (int i = a.size() - 1, j = b.size() - 1; i >= 0 && j >= 0; --i, --j) {
    if (a[i] > b[j]) return cout << "YES", 0;
  }
  cout << "NO";
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}
