#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int M = 100005;
const int mod = 1e9 + 7;
const double eps = 1e-6;
const double Pi = 2 * acos(0.0);
inline int max(int a, int b) { return a > b ? a : b; }
inline int min(int a, int b) { return a < b ? a : b; }
inline int bit(int x) { return 1 << x; }
inline double dabs(double x) { return x > 0 ? x : (-x); }
inline int abs(int x) { return x > 0 ? x : (-x); }
inline int lowbit(int x) { return x & (-x); }
int n, m, k;
int a[M], b[M];
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  sort(a, a + n);
  sort(b, b + m);
  int x = n - 1, y = m - 1;
  bool jud = 0;
  if (n > m) jud = 1;
  while (x >= 0 && y >= 0 && !jud) {
    if (a[x] > b[y]) jud = 1;
    x--, y--;
  }
  puts(jud ? "YES" : "NO");
  return 0;
}
