#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int a[111111], b[111111];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  a[0] = b[0] = -1;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= m; i++) scanf("%d", &b[i]);
  sort(a, a + n + 1);
  sort(b, b + m + 1);
  int ita = n, itb = m;
  int rank = a[ita];
  bool ans = false;
  while (rank >= 0) {
    while (a[ita] == rank) ita--;
    while (b[itb] >= rank) itb--;
    if (n - ita > m - itb) {
      ans = true;
      break;
    }
    rank = a[ita];
  }
  if (ans)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
