#include <bits/stdc++.h>
using namespace std;
vector<long long> a, b;
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, k;
  cin >> n >> m >> k;
  for (long long i = 0; i < n; i++) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  for (long long i = 0; i < m; i++) {
    int x;
    cin >> x;
    b.push_back(x);
  }
  if (n > m) return cout << "YES", 0;
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  while (!a.empty()) {
    if (a.back() > b.back()) return cout << "YES", 0;
    a.pop_back();
    b.pop_back();
  }
  cout << "NO";
  return 0;
}
