#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T getnum() {
  T num = 0;
  char c;
  do {
    c = getchar();
  } while (c != EOF && c == ' ' && c == '\n' && c == '\t');
  int sign = (c == '-' ? -1 : 1);
  if (c != '-') num += (c - '0');
  while ((c = getchar()) != EOF && c != '\n' && c != '\t' && c != ' ') {
    num *= 10;
    num += (c - '0');
  }
  num *= sign;
  return num;
}
inline string getstr() {
  string str;
  char k;
  while ((k = getchar()) == ' ' || k == '\n') {
    k = getchar();
    if (k == ' ' || k == '\n')
      continue;
    else
      break;
  }
  while ((k = getchar()) != EOF && k != '\n' && k != '\t' && k != '\v' &&
         k != '\0' && k != ' ')
    str.push_back(k);
  return str;
}
int a[100005], b[100005];
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = int(0), _b = int(n - 1); i <= _b; i++) scanf("%d", &a[i]);
  for (int i = int(0), _b = int(m - 1); i <= _b; i++) scanf("%d", &b[i]);
  sort(a, a + n);
  sort(b, b + m);
  reverse(a, a + n);
  reverse(b, b + m);
  if (n > m)
    puts("YES");
  else {
    bool win = 0;
    for (int i = int(0), _b = int(min(m, n) - 1); i <= _b; i++)
      win |= (a[i] > b[i]);
    puts(win ? "YES" : "NO");
  }
  return 0;
}
