#include <bits/stdc++.h>
using namespace std;
const int MAX = 100 * 1000 + 10;
int a[MAX], b[MAX];
int main() {
  ios::sync_with_stdio(false);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = (int)0; i < (int)n; ++i) cin >> a[i];
  for (int i = (int)0; i < (int)m; ++i) cin >> b[i];
  if (n > m) {
    cout << "YES" << endl;
    return 0;
  }
  sort(a, a + n);
  sort(b, b + m);
  for (int i = (int)n - 1; i > (int)-1; --i)
    if (a[i] > b[m - n + i]) {
      cout << "YES" << endl;
      return 0;
    }
  cout << "NO" << endl;
  return 0;
}
