#include <bits/stdc++.h>
using namespace std;
inline int two(int x) { return 1 << x; }
inline long long TWO(int x) { return (long long)1 << x; }
template <class T>
void Min(T &x, T y) {
  if (y < x) x = y;
}
template <class T>
void Max(T &x, T y) {
  if (y > x) x = y;
}
template <class T>
T _abs(T x) {
  return x > 0 ? x : -x;
}
template <class T>
T gcd(T a, T b) {
  return !b ? a : gcd(b, a % b);
}
const int maxn = 200010;
const int mod = 1000000007;
int get_val() {
  int ret(0);
  char c;
  while ((c = getchar()) == ' ' || c == '\n' || c == '\r')
    ;
  ret = c - '0';
  while ((c = getchar()) != ' ' && c != '\n' && c != '\r')
    ret = ret * 10 + c - '0';
  return ret;
}
int n, m, k;
int a[maxn], b[maxn];
int num[maxn];
int main() {
  cin >> n >> m >> k;
  map<int, int> mpa, mpb, mp;
  for (int i = 0; i < n; i++) a[i] = get_val(), mpa[a[i]]++, mp[a[i]]++;
  for (int i = 0; i < m; i++) b[i] = get_val(), mpb[b[i]]++, mp[b[i]]--;
  int tot = 0;
  for (map<int, int>::iterator it = mp.begin(); it != mp.end(); it++) {
    if (it->second) num[tot++] = it->second;
  }
  long long s1 = 0, s2 = 0;
  for (int i = tot; i >= 0; i--) {
    s1 += num[i];
    if (s1 > 0) {
      return puts("YES"), 0;
    }
  }
  puts("NO");
  return 0;
}
