import java.util.*;
import java.text.*;

public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {
        int x = sc.nextInt();
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();

        for (int i=-200; i<=200; i++) {
            list.add(i);
        }

        for (int i=0; i<n; i++) {
            int t = sc.nextInt();
            list.remove((Integer)t);
        }

        int res = 1000;
        int diff = 10000;

        for (Integer i: list) {
            if (Math.abs(x-i)<diff) {
                diff = Math.abs(x-i);
                res = i;
            }
        }

//        System.out.println(list);

        System.out.println(res);
    }


} import java.util.*; util.* java import java.text.*; text.* java public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {
        int x = sc.nextInt();
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();

        for (int i=-200; i<=200; i++) {
            list.add(i);
        }

        for (int i=0; i<n; i++) {
            int t = sc.nextInt();
            list.remove((Integer)t);
        }

        int res = 1000;
        int diff = 10000;

        for (Integer i: list) {
            if (Math.abs(x-i)<diff) {
                diff = Math.abs(x-i);
                res = i;
            }
        }

//        System.out.println(list);

        System.out.println(res);
    }


} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args void run() {
        int x = sc.nextInt();
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();

        for (int i=-200; i<=200; i++) {
            list.add(i);
        }

        for (int i=0; i<n; i++) {
            int t = sc.nextInt();
            list.remove((Integer)t);
        }

        int res = 1000;
        int diff = 10000;

        for (Integer i: list) {
            if (Math.abs(x-i)<diff) {
                diff = Math.abs(x-i);
                res = i;
            }
        }

//        System.out.println(list);

        System.out.println(res);
    } run {
        int x = sc.nextInt();
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();

        for (int i=-200; i<=200; i++) {
            list.add(i);
        }

        for (int i=0; i<n; i++) {
            int t = sc.nextInt();
            list.remove((Integer)t);
        }

        int res = 1000;
        int diff = 10000;

        for (Integer i: list) {
            if (Math.abs(x-i)<diff) {
                diff = Math.abs(x-i);
                res = i;
            }
        }

//        System.out.println(list);

        System.out.println(res);
    } int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc List<Integer> list = new ArrayList<>(); list new ArrayList<>() for (int i=-200; i<=200; i++) {
            list.add(i);
        } int i=-200; int i=-200; i -200 200 i<=200 i 200 i++ i++ i {
            list.add(i);
        } {
            list.add(i);
        } list.add(i) list.add list i for (int i=0; i<n; i++) {
            int t = sc.nextInt();
            list.remove((Integer)t);
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            int t = sc.nextInt();
            list.remove((Integer)t);
        } {
            int t = sc.nextInt();
            list.remove((Integer)t);
        } int t = sc.nextInt(); t sc.nextInt() sc.nextInt sc list.remove((Integer)t) list.remove list (Integer)t int res = 1000; res 1000 int diff = 10000; diff 10000 for (Integer i: list) {
            if (Math.abs(x-i)<diff) {
                diff = Math.abs(x-i);
                res = i;
            }
        } Integer i list {
            if (Math.abs(x-i)<diff) {
                diff = Math.abs(x-i);
                res = i;
            }
        } {
            if (Math.abs(x-i)<diff) {
                diff = Math.abs(x-i);
                res = i;
            }
        } if (Math.abs(x-i)<diff) {
                diff = Math.abs(x-i);
                res = i;
            } Math.abs(x-i)<diff Math.abs(x-i) Math.abs Math x-i x i diff {
                diff = Math.abs(x-i);
                res = i;
            } diff = Math.abs(x-i) diff Math.abs(x-i) Math.abs Math x-i x i res = i res i System.out.println(res) System.out.println System.out System System.out res public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {
        int x = sc.nextInt();
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();

        for (int i=-200; i<=200; i++) {
            list.add(i);
        }

        for (int i=0; i<n; i++) {
            int t = sc.nextInt();
            list.remove((Integer)t);
        }

        int res = 1000;
        int diff = 10000;

        for (Integer i: list) {
            if (Math.abs(x-i)<diff) {
                diff = Math.abs(x-i);
                res = i;
            }
        }

//        System.out.println(list);

        System.out.println(res);
    }


} public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {
        int x = sc.nextInt();
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();

        for (int i=-200; i<=200; i++) {
            list.add(i);
        }

        for (int i=0; i<n; i++) {
            int t = sc.nextInt();
            list.remove((Integer)t);
        }

        int res = 1000;
        int diff = 10000;

        for (Integer i: list) {
            if (Math.abs(x-i)<diff) {
                diff = Math.abs(x-i);
                res = i;
            }
        }

//        System.out.println(list);

        System.out.println(res);
    }


} Main
import java.util.*;
import java.text.*;

public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {
        int x = sc.nextInt();
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();

        for (int i=-200; i<=200; i++) {
            list.add(i);
        }

        for (int i=0; i<n; i++) {
            int t = sc.nextInt();
            list.remove((Integer)t);
        }

        int res = 1000;
        int diff = 10000;

        for (Integer i: list) {
            if (Math.abs(x-i)<diff) {
                diff = Math.abs(x-i);
                res = i;
            }
        }

//        System.out.println(list);

        System.out.println(res);
    }


}
