#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, m, k, a[maxn], b[maxn];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  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);
  sort(b, b + m);
  int l = 0, r = 0;
  while (1) {
    if (l == n || r == m) break;
    if (a[l] <= b[r]) {
      l++;
      r++;
    } else {
      r++;
    }
  }
  if (l == n)
    puts("NO");
  else
    puts("YES");
  return 0;
}
