#include <bits/stdc++.h>
using namespace std;
template <typename T>
std::ostream &operator<<(std::ostream &out, vector<T> &v) {
  for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
    out << v[i] << " ";
  out << "\n";
  return out;
}
template <typename T>
std::ostream &operator<<(std::ostream &out, set<T> &s) {
  for (auto e : s) out << e << " ";
  out << "\n";
  return out;
}
template <typename T, typename N>
std::ostream &operator<<(std::ostream &out, pair<T, N> &p) {
  out << "(" << p.first << ", " << p.second << ") ";
  return out;
}
template <typename T, typename N>
std::ostream &operator<<(std::ostream &out, vector<pair<T, N> > &v) {
  for (size_t i = 0; i < v.size(); ++i) cout << v[i];
  out << "\n";
  return out;
}
template <typename T>
std::ostream &operator<<(std::ostream &out, vector<vector<T> > &v) {
  for (size_t i = 0; i < v.size(); ++i) {
    for (size_t j = 0; j < v[i].size(); ++j) {
      out << v[i][j] << " ";
    }
    out << "\n";
  }
  return out;
}
template <typename T>
std::ostream &operator<<(std::ostream &out, vector<set<T> > &v) {
  for (size_t i = 0; i < v.size(); ++i) {
    out << v[i];
  }
  out << "\n";
  return out;
}
void solve() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> alice_fish(n);
  for (int i = 0; i < n; ++i) {
    cin >> alice_fish[i];
  }
  vector<int> bob_fish(m);
  for (int i = 0; i < m; ++i) {
    cin >> bob_fish[i];
  }
  sort(alice_fish.begin(), alice_fish.end());
  sort(bob_fish.begin(), bob_fish.end());
  int i = 0, j = 0;
  while (i < n && j < m) {
    if (alice_fish[i] == bob_fish[j]) {
      alice_fish[i] = -1;
      bob_fish[j] = -1;
      ++i;
      ++j;
    } else if (alice_fish[i] > bob_fish[j]) {
      ++j;
    } else {
      ++i;
    }
  }
  vector<int> new_alice;
  for (int i = 0; i < n; ++i) {
    if (alice_fish[i] != -1) {
      new_alice.push_back(alice_fish[i]);
    }
  }
  vector<int> new_bob;
  for (int i = 0; i < m; ++i) {
    if (bob_fish[i] != -1) {
      new_bob.push_back(bob_fish[i]);
    }
  }
  if (new_alice.size() == 0) {
    cout << "NO\n";
    return;
  }
  if (new_bob.size() == 0) {
    cout << "YES\n";
    return;
  }
  if (new_alice.back() > new_bob.back()) {
    cout << "YES\n";
    return;
  }
  i = 0, j = 0;
  int alice_superior = 0;
  while (i < new_alice.size() && j < new_bob.size()) {
    if (new_alice[i] > new_bob[j]) {
      ++alice_superior;
      while (j < new_bob.size() && new_alice[i] > new_bob[j]) {
        ++j;
      }
    } else {
      if (alice_superior > 0) {
        --alice_superior;
      }
      ++i;
      ++j;
    }
  }
  while (i < new_alice.size()) {
    ++alice_superior;
    ++i;
  }
  while (j < new_bob.size()) {
    --alice_superior;
    ++j;
  }
  if (alice_superior >= 1) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  return;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
