#include <bits/stdc++.h>
using namespace std;
int a[100005], b[100005];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int j = 0; j < m; j++) cin >> b[j];
  sort(a, a + n);
  sort(b, b + m);
  if (n > m) {
    cout << "YES\n";
    return 0;
  }
  for (int i = m - n; i < m; i++)
    if (a[i - m + n] > b[i]) {
      cout << "YES\n";
      return 0;
    }
  cout << "NO\n";
  return 0;
}
