#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-8;
vector<string> parse(string s, string c) {
  int len = c.length(), p = -len, np;
  vector<string> ans;
  do {
    np = s.find(c, p + len);
    ans.push_back(s.substr(p + len, np - p - len));
    p = np;
  } while (p != string::npos);
  return ans;
}
bool comp(int a, int b) { return (a > b); }
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> a, b;
  a.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  b.resize(m);
  for (int i = 0; i < m; i++) cin >> b[i];
  sort(a.begin(), a.end(), comp);
  sort(b.begin(), b.end(), comp);
  bool ans = false;
  if (n > m) ans = true;
  while (a.size() < b.size()) b.pop_back();
  for (int i = 0; i < b.size(); i++)
    if (a[i] > b[i]) ans = true;
  if (ans)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
