#include <bits/stdc++.h>
using namespace std;
bool compare(int, int);
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int a[n], b[m];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  if (n > m) {
    cout << "YES";
    return 0;
  }
  sort(a, a + n, compare);
  sort(b, b + m, compare);
  for (int i = 0; i < n; i++) {
    if (a[i] > b[i]) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
bool compare(int a, int b) { return a > b; }
