#include <bits/stdc++.h>
using namespace std;
int num_a[100009], num_b[100009];
int main() {
  int n, m, k, flg;
  while (cin >> n >> m >> k) {
    flg = 0;
    for (int i = 0; i < n; i++) cin >> num_a[i];
    for (int i = 0; i < m; i++) cin >> num_b[i];
    sort(num_a, num_a + n);
    sort(num_b, num_b + m);
    int fr = n - 1, rw = m - 1;
    for (; fr >= 0 && rw >= 0; fr--, rw--) {
      if (num_a[fr] > num_b[rw]) flg = 1;
    }
    if (flg || fr >= 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
