#include <bits/stdc++.h>
using namespace std;
int n, m, nm, k, v1[100000 + 10], v2[100000 + 10];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) cin >> v1[i];
  for (int i = 1; i <= m; i++) cin >> v2[i];
  sort(v1 + 1, v1 + n + 1);
  sort(v2 + 1, v2 + m + 1);
  int i = 1, j = 1, nr = 0;
  for (int i = n + 1; i <= max(n, m); i++) v1[i] = 2000000000;
  for (int j = m + 1; j <= max(n, m); j++) v2[i] = 2000000000;
  nm = max(n, m);
  v1[nm + 1] = v2[nm + 1] = 2000000000;
  while (v1[i] != 2000000000 || v2[j] != 2000000000) {
    if (v1[i] <= v2[j])
      nr = max(1, nr + 1), i++;
    else
      nr--, j++;
  }
  if (nr > 0)
    cout << "YES" << '\n';
  else
    cout << "NO" << '\n';
  return 0;
}
