#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long linf = ceil(pow(2.0, 62));
const double dinf = pow(2.0, 62);
const int maxn = 100005;
int n, m, k;
int a[maxn], b[maxn];
bool vis1[maxn], vis2[maxn];
vector<int> p, q;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= m; i++) scanf("%d", &b[i]);
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  if (n > m)
    printf("YES\n");
  else {
    bool sign = 0;
    int l = n, r = m;
    while (l >= 1 && r >= 1) {
      if (a[l] > b[r]) {
        sign = 1;
        break;
      }
      l--, r--;
    }
    if (sign)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
