#include <bits/stdc++.h>
using namespace std;
int n, m;
map<int, int> M;
int a[1000010], b[100010], c[1000010];
int k;
int alice[1000010], bob[1000010];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (!M[a[i]]) {
      M[a[i]] = 1;
      c[M.size()] = a[i];
    }
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d", &b[i]);
    if (!M[b[i]]) {
      M[b[i]] = 1;
      c[M.size()] = b[i];
    }
  }
  sort(c + 1, c + 1 + M.size());
  int len = M.size();
  for (int i = 1; i <= len; i++) M[c[i]] = i;
  for (int i = 1; i <= n; i++) alice[M[a[i]]]++;
  for (int i = 1; i <= m; i++) bob[M[b[i]]]++;
  int sum = 0;
  for (int i = len; i >= 1; i--) {
    sum += alice[i] - bob[i];
    if (sum > 0) {
      puts("YES");
      goto FUCK;
    }
  }
  puts("NO");
FUCK:;
}
