#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  std::vector<int> x(n);
  std::vector<int> y(m);
  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }
  for (int i = 0; i < m; ++i) {
    cin >> y[i];
  }
  std::sort(x.begin(), x.end());
  std::sort(y.begin(), y.end());
  size_t x_index = 0, y_index = 0;
  int cnt = 0;
  while (x_index < x.size() && y_index < y.size()) {
    if (x[x_index] <= y[y_index]) {
      x_index++;
      y_index++;
      cnt++;
    } else {
      y_index++;
    }
  }
  cout << (cnt == x.size() ? "NO" : "YES") << endl;
  return 0;
}
