#include <bits/stdc++.h>
const long long inf = 1e18 + 44;
const int MAX = 3e5 + 9;
const long long int MOD = 1e9 + 7;
const double eps = 1e-1;
double const PI = 3.1415926535897931;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, k;
  cin >> n >> m >> k;
  long long int sum = 0;
  map<long long int, long long int> mp;
  for (int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    mp[-x]++;
  }
  for (int i = 0; i < m; i++) {
    long long int x;
    cin >> x;
    mp[-x]--;
  }
  bool ok = false;
  for (auto now : mp) {
    sum = sum + now.second;
    ok = ok | (sum > 0);
  }
  if (ok)
    cout << "YES";
  else
    cout << "NO";
}
