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