#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[maxn], b[maxn];
int n, m, k;
multiset<pair<int, int> > s;
int main() {
  int cnt = 0;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= m; i++) cin >> b[i];
  for (int i = 1; i <= n; i++) s.insert(make_pair(a[i], 0));
  for (int i = 1; i <= m; i++) s.insert(make_pair(b[i], 1));
  if (m < n) {
    cout << "YES";
    return 0;
  }
  while (!s.empty()) {
    pair<int, int> p;
    p = *s.rbegin();
    s.erase(--s.end());
    if (p.second == 1)
      cnt--;
    else
      cnt++;
    if (cnt > 0) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
}
