#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 10;
map<int, int> x, y;
map<int, int>::iterator it, it2;
vector<int> a(N), b(N);
int n, m, t;
int main() {
  scanf("%d%d%d", &n, &m, &t);
  for (int i = 1; i <= n; i++) {
    int k;
    scanf("%d", &k);
    x[k]++;
  }
  for (int i = 1; i <= m; i++) {
    int k;
    scanf("%d", &k);
    y[k]++;
  }
  for (it = x.begin(); it != x.end(); it++) {
    it2 = y.find(it->first);
    if (it2 == y.end()) continue;
    int mn = min(it->second, it2->second);
    it->second -= mn, it2->second -= mn;
  }
  for (it = x.begin(); it != x.end(); it++)
    for (int i = 1; i <= it->second; i++) a[++a[0]] = it->first;
  for (it = y.begin(); it != y.end(); it++)
    for (int i = 1; i <= it->second; i++) b[++b[0]] = it->first;
  if (a[0] == 0) {
    puts("NO");
    return 0;
  }
  if (b[0] == 0 || a[0] > b[0]) {
    puts("YES");
    return 0;
  }
  int i = a[0], j = b[0];
  while (i >= 1 && j >= 1) {
    if (a[i] > b[j]) {
      puts("YES");
      return 0;
    } else {
      i--, j--;
    }
  }
  puts("NO");
  return 0;
}
