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