import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.TreeMap;
import java.util.Map;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int x = Integer.parseInt(in.next());
            int n = Integer.parseInt(in.next());

            if (n == 0) {
                out.println(x);
                return;
            }
            int[] p = new int[n];
            for (int i = 0; i < n; i++) {
                p[i] = Integer.parseInt(in.next());
            }
            Arrays.sort(p);
            int ans = Integer.MAX_VALUE;
            boolean ng = false;
            Map<Integer, Integer> mp = new TreeMap<>();
            for (int i = 101; i >= 0; i--) {
                for (int j = 0; j < n; j++) {
                    if (i == p[j]) {
                        ng = true;
                        break;
                    }
                }
                if (!ng) {
                    int tmp = Math.abs(x - i);
                    mp.put(tmp, i);
                }
                ng = false;

            }

            // 出力
            for (Integer val : mp.values()) {
                out.println(val.toString());
                return;
            }
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Arrays; Arrays java.util import java.util.TreeMap; TreeMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int x = Integer.parseInt(in.next());
            int n = Integer.parseInt(in.next());

            if (n == 0) {
                out.println(x);
                return;
            }
            int[] p = new int[n];
            for (int i = 0; i < n; i++) {
                p[i] = Integer.parseInt(in.next());
            }
            Arrays.sort(p);
            int ans = Integer.MAX_VALUE;
            boolean ng = false;
            Map<Integer, Integer> mp = new TreeMap<>();
            for (int i = 101; i >= 0; i--) {
                for (int j = 0; j < n; j++) {
                    if (i == p[j]) {
                        ng = true;
                        break;
                    }
                }
                if (!ng) {
                    int tmp = Math.abs(x - i);
                    mp.put(tmp, i);
                }
                ng = false;

            }

            // 出力
            for (Integer val : mp.values()) {
                out.println(val.toString());
                return;
            }
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) C solver = new C(); solver new C() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int x = Integer.parseInt(in.next());
            int n = Integer.parseInt(in.next());

            if (n == 0) {
                out.println(x);
                return;
            }
            int[] p = new int[n];
            for (int i = 0; i < n; i++) {
                p[i] = Integer.parseInt(in.next());
            }
            Arrays.sort(p);
            int ans = Integer.MAX_VALUE;
            boolean ng = false;
            Map<Integer, Integer> mp = new TreeMap<>();
            for (int i = 101; i >= 0; i--) {
                for (int j = 0; j < n; j++) {
                    if (i == p[j]) {
                        ng = true;
                        break;
                    }
                }
                if (!ng) {
                    int tmp = Math.abs(x - i);
                    mp.put(tmp, i);
                }
                ng = false;

            }

            // 出力
            for (Integer val : mp.values()) {
                out.println(val.toString());
                return;
            }
        }

    } C public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int x = Integer.parseInt(in.next());
            int n = Integer.parseInt(in.next());

            if (n == 0) {
                out.println(x);
                return;
            }
            int[] p = new int[n];
            for (int i = 0; i < n; i++) {
                p[i] = Integer.parseInt(in.next());
            }
            Arrays.sort(p);
            int ans = Integer.MAX_VALUE;
            boolean ng = false;
            Map<Integer, Integer> mp = new TreeMap<>();
            for (int i = 101; i >= 0; i--) {
                for (int j = 0; j < n; j++) {
                    if (i == p[j]) {
                        ng = true;
                        break;
                    }
                }
                if (!ng) {
                    int tmp = Math.abs(x - i);
                    mp.put(tmp, i);
                }
                ng = false;

            }

            // 出力
            for (Integer val : mp.values()) {
                out.println(val.toString());
                return;
            }
        } solve {
            // 入力
            int x = Integer.parseInt(in.next());
            int n = Integer.parseInt(in.next());

            if (n == 0) {
                out.println(x);
                return;
            }
            int[] p = new int[n];
            for (int i = 0; i < n; i++) {
                p[i] = Integer.parseInt(in.next());
            }
            Arrays.sort(p);
            int ans = Integer.MAX_VALUE;
            boolean ng = false;
            Map<Integer, Integer> mp = new TreeMap<>();
            for (int i = 101; i >= 0; i--) {
                for (int j = 0; j < n; j++) {
                    if (i == p[j]) {
                        ng = true;
                        break;
                    }
                }
                if (!ng) {
                    int tmp = Math.abs(x - i);
                    mp.put(tmp, i);
                }
                ng = false;

            }

            // 出力
            for (Integer val : mp.values()) {
                out.println(val.toString());
                return;
            }
        } int x = Integer.parseInt(in.next()); x Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in int n = Integer.parseInt(in.next()); n Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in if (n == 0) {
                out.println(x);
                return;
            } n == 0 n 0 {
                out.println(x);
                return;
            } out.println(x) out.println out x return; int[] p = new int[n]; p new int[n] n for (int i = 0; i < n; i++) {
                p[i] = Integer.parseInt(in.next());
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                p[i] = Integer.parseInt(in.next());
            } {
                p[i] = Integer.parseInt(in.next());
            } p[i] = Integer.parseInt(in.next()) p[i] p i Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in Arrays.sort(p) Arrays.sort Arrays p int ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE boolean ng = false; ng false Map<Integer, Integer> mp = new TreeMap<>(); mp new TreeMap<>() for (int i = 101; i >= 0; i--) {
                for (int j = 0; j < n; j++) {
                    if (i == p[j]) {
                        ng = true;
                        break;
                    }
                }
                if (!ng) {
                    int tmp = Math.abs(x - i);
                    mp.put(tmp, i);
                }
                ng = false;

            } int i = 101; int i = 101; i 101 i >= 0 i 0 i-- i-- i {
                for (int j = 0; j < n; j++) {
                    if (i == p[j]) {
                        ng = true;
                        break;
                    }
                }
                if (!ng) {
                    int tmp = Math.abs(x - i);
                    mp.put(tmp, i);
                }
                ng = false;

            } {
                for (int j = 0; j < n; j++) {
                    if (i == p[j]) {
                        ng = true;
                        break;
                    }
                }
                if (!ng) {
                    int tmp = Math.abs(x - i);
                    mp.put(tmp, i);
                }
                ng = false;

            } for (int j = 0; j < n; j++) {
                    if (i == p[j]) {
                        ng = true;
                        break;
                    }
                } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
                    if (i == p[j]) {
                        ng = true;
                        break;
                    }
                } {
                    if (i == p[j]) {
                        ng = true;
                        break;
                    }
                } if (i == p[j]) {
                        ng = true;
                        break;
                    } i == p[j] i p[j] p j {
                        ng = true;
                        break;
                    } ng = true ng true break; if (!ng) {
                    int tmp = Math.abs(x - i);
                    mp.put(tmp, i);
                } !ng ng {
                    int tmp = Math.abs(x - i);
                    mp.put(tmp, i);
                } int tmp = Math.abs(x - i); tmp Math.abs(x - i) Math.abs Math x - i x i mp.put(tmp, i) mp.put mp tmp i ng = false ng false for (Integer val : mp.values()) {
                out.println(val.toString());
                return;
            } Integer val mp.values() mp.values mp {
                out.println(val.toString());
                return;
            } {
                out.println(val.toString());
                return;
            } out.println(val.toString()) out.println out val.toString() val.toString val return; int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int x = Integer.parseInt(in.next());
            int n = Integer.parseInt(in.next());

            if (n == 0) {
                out.println(x);
                return;
            }
            int[] p = new int[n];
            for (int i = 0; i < n; i++) {
                p[i] = Integer.parseInt(in.next());
            }
            Arrays.sort(p);
            int ans = Integer.MAX_VALUE;
            boolean ng = false;
            Map<Integer, Integer> mp = new TreeMap<>();
            for (int i = 101; i >= 0; i--) {
                for (int j = 0; j < n; j++) {
                    if (i == p[j]) {
                        ng = true;
                        break;
                    }
                }
                if (!ng) {
                    int tmp = Math.abs(x - i);
                    mp.put(tmp, i);
                }
                ng = false;

            }

            // 出力
            for (Integer val : mp.values()) {
                out.println(val.toString());
                return;
            }
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int x = Integer.parseInt(in.next());
            int n = Integer.parseInt(in.next());

            if (n == 0) {
                out.println(x);
                return;
            }
            int[] p = new int[n];
            for (int i = 0; i < n; i++) {
                p[i] = Integer.parseInt(in.next());
            }
            Arrays.sort(p);
            int ans = Integer.MAX_VALUE;
            boolean ng = false;
            Map<Integer, Integer> mp = new TreeMap<>();
            for (int i = 101; i >= 0; i--) {
                for (int j = 0; j < n; j++) {
                    if (i == p[j]) {
                        ng = true;
                        break;
                    }
                }
                if (!ng) {
                    int tmp = Math.abs(x - i);
                    mp.put(tmp, i);
                }
                ng = false;

            }

            // 出力
            for (Integer val : mp.values()) {
                out.println(val.toString());
                return;
            }
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.TreeMap;
import java.util.Map;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int x = Integer.parseInt(in.next());
            int n = Integer.parseInt(in.next());

            if (n == 0) {
                out.println(x);
                return;
            }
            int[] p = new int[n];
            for (int i = 0; i < n; i++) {
                p[i] = Integer.parseInt(in.next());
            }
            Arrays.sort(p);
            int ans = Integer.MAX_VALUE;
            boolean ng = false;
            Map<Integer, Integer> mp = new TreeMap<>();
            for (int i = 101; i >= 0; i--) {
                for (int j = 0; j < n; j++) {
                    if (i == p[j]) {
                        ng = true;
                        break;
                    }
                }
                if (!ng) {
                    int tmp = Math.abs(x - i);
                    mp.put(tmp, i);
                }
                ng = false;

            }

            // 出力
            for (Integer val : mp.values()) {
                out.println(val.toString());
                return;
            }
        }

    }
}

