#include <bits/stdc++.h>
using namespace std;
map<int, int> h, g;
map<int, int>::reverse_iterator rit, rit2;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int(i) = 0; (i) < (int)(n); ++(i)) {
    int x;
    cin >> x;
    h[x]++;
  }
  for (int(i) = 0; (i) < (int)(m); ++(i)) {
    int x;
    cin >> x;
    g[x]++;
  }
  long long s1 = 0, s2 = 0;
  rit2 = g.rbegin();
  for (rit = h.rbegin(); rit != h.rend(); rit++) {
    s1 += rit->second;
    while (rit2 != g.rend() && rit2->first >= rit->first) {
      s2 += rit2->second;
      rit2++;
    }
    if (s1 > s2) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
