#include <bits/stdc++.h>
using namespace std;
int n, m, k, a[100010], b[100010];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= m; ++i) scanf("%d", &b[i]);
  sort(b + 1, b + m + 1);
  int cur = 1;
  for (int i = 1; i <= n; ++i) {
    while ((cur <= m) && (a[i] > b[cur])) ++cur;
    if (cur > m) {
      puts("YES");
      return 0;
    }
    ++cur;
  }
  puts("NO");
  return 0;
}
