#include <bits/stdc++.h>
using namespace std;
int a[100005], b[100005];
int main() {
  int n, m, k;
  map<int, int> f1;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  bool f = false;
  sort(a, a + n);
  sort(b, b + m);
  reverse(a, a + n);
  reverse(b, b + m);
  if (n <= m) {
    for (int i = 0; i < n; i++) {
      if (a[i] > b[i]) {
        f = true;
        break;
      }
    }
  } else {
    f = true;
  }
  if (f) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
