#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, m, k, s1[maxn], s2[maxn];
int main() {
  int t, q, i, j, cnt, t1 = 1, t2 = 1, f = 0;
  cin >> n >> m >> k;
  for (i = 1; i <= n; i++) scanf("%d", s1 + i);
  for (i = 1; i <= m; i++) scanf("%d", s2 + i);
  sort(s1 + 1, s1 + n + 1);
  sort(s2 + 1, s2 + m + 1);
  while (t1 <= n && t2 <= m) {
    if (s1[t1] <= s2[t2])
      t1++, t2++;
    else {
      f = 1;
      while (t2 <= m && s2[t2] < s1[t1]) t2++;
      t1++;
    }
  }
  if (t2 > m && (f || t1 <= n))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
