#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1.0);
const int maxn = (int)1e5 + 10;
int a[maxn], b[maxn];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> w(n + m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    w[i] = a[i];
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &b[i]);
    w[i + n] = b[i];
  }
  sort((w).begin(), (w).end());
  w.erase(unique((w).begin(), (w).end()), w.end());
  int r = (int)(w).size();
  vector<int> v(r, 0);
  for (int i = 0; i < n; i++) {
    int pos = lower_bound((w).begin(), (w).end(), a[i]) - w.begin();
    v[pos]++;
  }
  for (int i = 0; i < m; i++) {
    int pos = lower_bound((w).begin(), (w).end(), b[i]) - w.begin();
    v[pos]--;
  }
  long long sum = 0;
  for (int i = r - 1; i >= 0; i--) {
    sum = sum + v[i];
    if (sum > 0) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
