#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const long long INF = 1e12;
int n, m, k, a[maxn], b[maxn], Aid, Bid;
pair<long long, long long> total;
bool cmp(int a, int b) { return a > b; }
int main() {
  cin >> n >> m >> k;
  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, cmp);
  sort(b, b + m, cmp);
  int ptr1 = 0, ptr2 = 0;
  for (int i = 0; i < n; i++) {
    if (b[i] >= a[i]) {
      total.first++;
      total.second++;
    } else {
      total.first++;
      Aid = i + 1;
      Bid = i;
      break;
    }
  }
  if (1LL * total.first * INF + (n - Aid) >
      1LL * total.second * INF + (m - Bid)) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
