It is known that there are k fish species in the polar ocean, numbered from 1 to k. They are sorted by non-decreasing order of their weight, which is a positive number. Let the weight of the i-th type of fish be wi, then 0 < w1 ≤ w2 ≤ ... ≤ wk holds.

Polar bears Alice and Bob each have caught some fish, and they are guessing who has the larger sum of weight of the fish he/she's caught. Given the type of the fish they've caught, determine whether it is possible that the fish caught by Alice has a strictly larger total weight than Bob's. In other words, does there exist a sequence of weights wi (not necessary integers), such that the fish caught by Alice has a strictly larger total weight?

Input

The first line contains three integers n, m, k (1 ≤ n, m ≤ 105, 1 ≤ k ≤ 109) — the number of fish caught by Alice and Bob respectively, and the number of fish species.

The second line contains n integers each from 1 to k, the list of fish type caught by Alice. The third line contains m integers each from 1 to k, the list of fish type caught by Bob.

Note that one may have caught more than one fish for a same species.

Output

Output "YES" (without quotes) if it is possible, and "NO" (without quotes) otherwise.

Examples

Input

3 3 3
2 2 2
1 1 3


Output

YES


Input

4 7 9
5 2 7 3
3 5 2 7 3 8 7


Output

NO

Note

In the first sample, if w1 = 1, w2 = 2, w3 = 2.5, then Alice has a total of 2 + 2 + 2 = 6 weight units, while Bob only has 1 + 1 + 2.5 = 4.5.

In the second sample, the fish that Alice caught is a subset of Bob's. Therefore, the total weight of Bob’s fish is always not less than the total weight of Alice’s fish.

import java.io.*;
import java.math.BigInteger;
import java.util.*;



public class B {
    private static final int mod = (int)1e9+7;
    
    public void run() throws IOException {
        final int n = IOFast.nextInt();
        final int m = IOFast.nextInt();
        final int k = IOFast.nextInt();
        
        final int[] vs = new int[1000000];

        final int[] xs = new int[n];
        final int[] ys = new int[m];
        final Integer[] zs = new Integer[m + n];
        int idx = 0;
        
        for(int i = 0; i < n; i++) zs[idx++] = xs[i] = IOFast.nextInt();
        for(int i = 0; i < m; i++) zs[idx++] = ys[i] = IOFast.nextInt();

        Arrays.sort(zs);
        
        for(int i = 0; i < n; i++) vs[Arrays.binarySearch(zs, xs[i])]++;
        for(int i = 0; i < m; i++) vs[Arrays.binarySearch(zs, ys[i])]--;
        
        for(int i = vs.length - 1; i > 0; i--) vs[i-1] += vs[i];
        for(int i = vs.length - 1; i >= 0; i--) {
            if(vs[i] > 0) {
                IOFast.out.println("YES");
                return;
            }
        }
        
        IOFast.out.println("NO");
    }


    public static void main(String[] args) throws IOException {
        //      IOFast.setFileIO("input.txt", "output.txt");
        new B().run();
        IOFast.out.flush();
    }
    

    static public class IOFast {
        private static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        private static PrintWriter out = new PrintWriter(System.out);

        static void setFileIO(String ins, String outs) throws IOException {
            try {
                in = new BufferedReader(new FileReader(ins));
                out = new PrintWriter(new FileWriter(outs));
            }
            catch(IOException e) {
                System.err.println(e);
                throw e;
            }
        }

        //      private static final int BUFFER_SIZE = 50 * 200000;
        private static int pos, readLen;
        private static final char[] buffer = new char[1024 * 8];
        private static final StringBuilder buf = new StringBuilder();
        private static boolean[] isDigit = new boolean[256];
        private static boolean[] isSpace = new boolean[256];

        static {
            for(int i = 0; i < 10; i++) {
                isDigit['0' + i] = true;
            }
            isDigit['-'] = true;
            isSpace[' '] = isSpace['\r'] = isSpace['\n'] = isSpace['\t'] = true;
        }

        static boolean endInput;

        private static int read() throws IOException {
            if(readLen == -1) {
                return -1;
            }

            if(pos >= readLen) {
                readLen = in.read(buffer);
                pos = 0;

                if(readLen <= 0) {
                    return -1;
                }
            }

            return buffer[pos++];
        }

        private static int nextInt() throws IOException {
            boolean plus = false;
            int ret = 0;
            while(true) {
                final int c = read();

                if(c == -1) {
                    endInput = true;
                    return Integer.MIN_VALUE;
                }

                if(isDigit[c]) {
                    if(c != '-') {
                        plus = true;
                        ret = c - '0';
                    }
                    break;
                }
            }

            while(true) {
                final int c = read();
                if(c == -1 || !isDigit[c]) {
                    break;
                }
                ret = ret * 10 + c - '0';
            }

            return plus ? ret : -ret;
        }

        private static long nextLong() throws IOException {
            boolean plus = false;
            long ret = 0;
            while(true) {
                final int c = read();

                if(c == -1) {
                    endInput = true;
                    return Integer.MIN_VALUE;
                }

                if(isDigit[c]) {
                    if(c != '-') {
                        plus = true;
                        ret = c - '0';
                    }
                    break;
                }
            }

            while(true) {
                final int c = read();
                if(c == -1 || !isDigit[c]) {
                    break;
                }
                ret = ret * 10 + c - '0';
            }

            return plus ? ret : -ret;
        }

        private static char nextChar() throws IOException {
            while(true) {
                final int c = read();

                if(c == -1) {
                    endInput = true;
                    return '\0';
                }

                if(!isSpace[c]) {
                    return (char)c;
                }
            }
        }

        private static String next() throws IOException {
            buf.setLength(0);

            while(true) {
                final int c = read();

                if(c == -1) {
                    endInput = true;
                    return "-1";
                }

                if(!isSpace[c]) {
                    buf.append((char)c);
                    break;
                }
            }

            while(true) {
                final int c = read();

                if(c == -1 || isSpace[c]) {
                    break;
                }
                buf.append((char)c);
            }

            return buf.toString();
        }

        private static double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

    }

}
