#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int dx[8] = {1, 0, -1, 0, -1, -1, 1, 1};
const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
const int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int leap[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int n, m, k;
map<int, int> M, M2;
vector<pair<int, int> > V;
int main() {
  while (scanf("%d%d%d", &n, &m, &k) == 3) {
    M.clear();
    M2.clear();
    V.clear();
    int p;
    for (int i = 0; i < n; ++i) {
      scanf("%d", &p);
      M[p]++;
    }
    for (int i = 0; i < m; ++i) {
      scanf("%d", &p);
      M2[p]++;
    }
    bool bi = true;
    for (map<int, int>::iterator it = M.begin(); bi && it != M.end(); ++it)
      if (M2.find(it->first) == M2.end())
        V.push_back(make_pair(it->first, it->second));
      else if (it->second - M2[it->first] != 0)
        V.push_back(make_pair(it->first, it->second - M2[it->first]));
    for (map<int, int>::iterator it = M2.begin(); bi && it != M2.end(); ++it)
      if (M.find(it->first) == M.end())
        V.push_back(make_pair(it->first, -it->second));
    sort(V.begin(), V.end());
    int t = 0;
    for (int i = V.size() - 1; t <= 0 && i >= 0; --i) t += V[i].second;
    if (t > 0)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
