#include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = 1e5 + 52;
int n, m, k;
map<int, int, greater<int>> a;
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a[x]++;
  }
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    a[x]--;
  }
  int sum = 0;
  map<int, int>::iterator it;
  for (it = a.begin(); it != a.end(); it++) {
    sum += (*it).second;
    if (sum > 0) {
      return cout << "YES", 0;
    }
  }
  return cout << "NO", 0;
}
