#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int a[100010], b[100010];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  int i;
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  for (i = 0; i < m; i++) scanf("%d", &b[i]);
  sort(a, a + n);
  sort(b, b + m);
  int j;
  bool is = false;
  for (i = 0; i < n; i++) {
    int t = lower_bound(b, b + m, a[i]) - b;
    if (n - i > m - t) {
      is = true;
      break;
    }
  }
  if (is)
    printf("YES\n");
  else
    printf("NO\n");
}
