#include <bits/stdc++.h>
using namespace std;
int n, m, K, a[100010], b[100010];
void Init() {
  int x;
  scanf("%d%d%d", &n, &m, &K);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= m; i++) scanf("%d", &b[i]);
}
void solve() {
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  int p = 1, i;
  for (i = 1; i <= n; i++) {
    while (p <= m && b[p] < a[i]) p++;
    if (p > m) break;
    p++;
  }
  (p > m && i <= n) ? printf("YES\n") : printf("NO\n");
}
int main() {
  Init();
  solve();
  return 0;
}
