#include <bits/stdc++.h>
using namespace std;
int const maxn = (int)1e5 + 111;
int const inf = (1 << 30) - 1;
int n, m, k;
int a[maxn], b[maxn];
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= m; i++) cin >> b[i];
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  int l = 1;
  for (int i = 1; i <= n; i++) {
    int ind = lower_bound(b + l, b + m + 1, a[i]) - b;
    l = ind + 1;
    if (ind > m) {
      cout << "YES" << endl;
      return 0;
    }
    b[ind] = 0;
  }
  cout << "NO" << endl;
  return 0;
}
