#include <bits/stdc++.h>
using namespace std;
int F[200010], S[200010];
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    cin >> F[i];
  }
  sort(F, F + n);
  int mini = F[0];
  int real_m = 0;
  for (int j = 0; j < m; j++) {
    int aux;
    cin >> aux;
    if (aux < mini) continue;
    S[real_m++] = aux;
  }
  m = real_m;
  sort(S, S + m);
  if (n > m || S[m - 1] < F[n - 1]) {
    cout << "YES\n";
  } else {
    int I = 0, J = 0;
    while (I < n && J < m) {
      if (F[I] <= S[J]) {
        I++;
        J++;
      } else {
        J++;
      }
    }
    if (I == n) {
      cout << "NO\n";
    } else {
      cout << "YES\n";
    }
  }
  return 0;
}
