#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> a, b;
int main() {
  int n, m, k, x;
  cin >> n >> m >> k;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    a.push_back(x);
  }
  for (int i = 0; i < m; ++i) {
    cin >> x;
    b.push_back(x);
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  int i = a.size() - 1;
  int j = b.size() - 1;
  while (i >= 0 && j >= 0 && a[i] <= b[j]) {
    --i;
    --j;
  }
  if (i >= 0)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
