#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int main() {
  long long a[100001];
  long long b[100001];
  cin >> n;
  cin >> m;
  cin >> k;
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
  }
  int tmp = m > n ? m : n;
  sort(a + 1, a + tmp + 1);
  sort(b + 1, b + tmp + 1);
  bool ans = false;
  for (int i = tmp, j = 1; j <= tmp; j++, i--) {
    if (a[i] > b[i]) {
      ans = true;
      cout << "YES" << endl;
      break;
    }
  }
  if (!ans) cout << "NO" << endl;
  return 0;
}
