#include <bits/stdc++.h>
using namespace std;
bool cmp(int x, int y) {
  if (x > y)
    return true;
  else
    return false;
}
long long a[101000], b[100100], c[101000];
long long i, j, k, m, n;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  memset(c, 0, sizeof(c));
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < m; i++) scanf("%d", &b[i]);
  sort(a, a + n, cmp);
  sort(b, b + m, cmp);
  for (int i = 0; i < max(n, m); i++) c[i] = b[i] - a[i];
  bool bb = true;
  for (i = 0; i < max(n, m); i++)
    if (c[i] < 0) bb = false;
  if (!bb)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
