#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 100;
int n, m, k;
int a[maxn], b[maxn];
bool yes;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m >> k;
  for (int i = 0, _n = (int)(n); i < _n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 0, _n = (int)(m); i < _n; i++) cin >> b[i];
  sort(b, b + m);
  if (n > m) yes = true;
  int x = n - 1, y = m - 1;
  while (x >= 0) {
    if (a[x] > b[y]) yes = true;
    x--, y--;
  }
  cout << (yes ? "YES" : "NO") << endl;
  {
    int _;
    cin >> _;
    return 0;
  }
}
