#include <bits/stdc++.h>
using namespace std;
map<int, int> MAP;
map<int, int>::iterator it;
int main() {
  int i, n, m, k, x, now = 0;
  scanf("%d%d%d", &n, &m, &k);
  for (i = 1; i <= n; i++) scanf("%d", &x), MAP[x]++;
  for (i = 1; i <= m; i++) scanf("%d", &x), MAP[x]--;
  for (it = MAP.begin(); it != MAP.end(); it++) {
    now += it->second;
    if (now < 0) now = 0;
  }
  if (now > 0)
    puts("YES");
  else
    puts("NO");
  return 0;
}
