#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const int inf = 0x3f3f3f3f;
int a[N], b[N];
int main() {
  int n, m, k;
  while (scanf("%d%d%d", &n, &m, &k) != EOF) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    for (int i = 1; i <= m; i++) scanf("%d", &b[i]);
    sort(a + 1, a + n + 1);
    sort(b + 1, b + m + 1);
    int id = 1, cnt = 0;
    for (int i = 1; i <= n; i++) {
      while (id <= m && a[i] > b[id]) id++;
      if (id > m) break;
      if (a[i] <= b[id]) {
        cnt++;
        id++;
      }
    }
    if (cnt == n)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
