#include <bits/stdc++.h>
using namespace std;
long long a[200005], b[200005];
bool comp(long long x, long long y) { return x >= y; }
int main() {
  std::ios::sync_with_stdio(false);
  long long n, m, k;
  cin >> n >> m >> k;
  for (long long i = (long long)(0); i <= (long long)(n - 1); i++) cin >> a[i];
  for (long long i = (long long)(0); i <= (long long)(m - 1); i++) cin >> b[i];
  if (n > m) {
    cout << "YES" << endl;
    return 0;
  }
  sort(a, a + n);
  sort(b, b + m);
  reverse(a, a + n);
  reverse(b, b + m);
  for (long long i = (long long)(0); i <= (long long)(n - 1); i++) {
    if (a[i] > b[i]) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
