
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int n = sc.nextInt();
        int[] p = new int[n];
        int ans = 0;
        int ab = 100;
        for (int i = 0 ; i < n ; i++) {
            p[i] = sc.nextInt();
        }
        for (int i = -100 ; i <= 101 ; i++) {
            boolean flg = true;
            for (int j = 0 ; j < n ; j++) {
                if (i == p[j]) {
                    flg = false;
                }
            }

            if (flg) {
                if (Math.abs(i - x) < ab) {
                    ans = i;
                    ab = Math.abs(i - x);
                }
            }
        }
        System.out.println(ans);
    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int n = sc.nextInt();
        int[] p = new int[n];
        int ans = 0;
        int ab = 100;
        for (int i = 0 ; i < n ; i++) {
            p[i] = sc.nextInt();
        }
        for (int i = -100 ; i <= 101 ; i++) {
            boolean flg = true;
            for (int j = 0 ; j < n ; j++) {
                if (i == p[j]) {
                    flg = false;
                }
            }

            if (flg) {
                if (Math.abs(i - x) < ab) {
                    ans = i;
                    ab = Math.abs(i - x);
                }
            }
        }
        System.out.println(ans);
    }

} Main public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int n = sc.nextInt();
        int[] p = new int[n];
        int ans = 0;
        int ab = 100;
        for (int i = 0 ; i < n ; i++) {
            p[i] = sc.nextInt();
        }
        for (int i = -100 ; i <= 101 ; i++) {
            boolean flg = true;
            for (int j = 0 ; j < n ; j++) {
                if (i == p[j]) {
                    flg = false;
                }
            }

            if (flg) {
                if (Math.abs(i - x) < ab) {
                    ans = i;
                    ab = Math.abs(i - x);
                }
            }
        }
        System.out.println(ans);
    } main {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int n = sc.nextInt();
        int[] p = new int[n];
        int ans = 0;
        int ab = 100;
        for (int i = 0 ; i < n ; i++) {
            p[i] = sc.nextInt();
        }
        for (int i = -100 ; i <= 101 ; i++) {
            boolean flg = true;
            for (int j = 0 ; j < n ; j++) {
                if (i == p[j]) {
                    flg = false;
                }
            }

            if (flg) {
                if (Math.abs(i - x) < ab) {
                    ans = i;
                    ab = Math.abs(i - x);
                }
            }
        }
        System.out.println(ans);
    } @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] p = new int[n]; p new int[n] n int ans = 0; ans 0 int ab = 100; ab 100 for (int i = 0 ; i < n ; i++) {
            p[i] = sc.nextInt();
        } int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
            p[i] = sc.nextInt();
        } {
            p[i] = sc.nextInt();
        } p[i] = sc.nextInt() p[i] p i sc.nextInt() sc.nextInt sc for (int i = -100 ; i <= 101 ; i++) {
            boolean flg = true;
            for (int j = 0 ; j < n ; j++) {
                if (i == p[j]) {
                    flg = false;
                }
            }

            if (flg) {
                if (Math.abs(i - x) < ab) {
                    ans = i;
                    ab = Math.abs(i - x);
                }
            }
        } int i = -100 ; int i = -100 ; i -100 100 i <= 101 i 101 i++ i++ i {
            boolean flg = true;
            for (int j = 0 ; j < n ; j++) {
                if (i == p[j]) {
                    flg = false;
                }
            }

            if (flg) {
                if (Math.abs(i - x) < ab) {
                    ans = i;
                    ab = Math.abs(i - x);
                }
            }
        } {
            boolean flg = true;
            for (int j = 0 ; j < n ; j++) {
                if (i == p[j]) {
                    flg = false;
                }
            }

            if (flg) {
                if (Math.abs(i - x) < ab) {
                    ans = i;
                    ab = Math.abs(i - x);
                }
            }
        } boolean flg = true; flg true for (int j = 0 ; j < n ; j++) {
                if (i == p[j]) {
                    flg = false;
                }
            } int j = 0 ; int j = 0 ; j 0 j < n j n j++ j++ j {
                if (i == p[j]) {
                    flg = false;
                }
            } {
                if (i == p[j]) {
                    flg = false;
                }
            } if (i == p[j]) {
                    flg = false;
                } i == p[j] i p[j] p j {
                    flg = false;
                } flg = false flg false if (flg) {
                if (Math.abs(i - x) < ab) {
                    ans = i;
                    ab = Math.abs(i - x);
                }
            } flg {
                if (Math.abs(i - x) < ab) {
                    ans = i;
                    ab = Math.abs(i - x);
                }
            } if (Math.abs(i - x) < ab) {
                    ans = i;
                    ab = Math.abs(i - x);
                } Math.abs(i - x) < ab Math.abs(i - x) Math.abs Math i - x i x ab {
                    ans = i;
                    ab = Math.abs(i - x);
                } ans = i ans i ab = Math.abs(i - x) ab Math.abs(i - x) Math.abs Math i - x i x System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int n = sc.nextInt();
        int[] p = new int[n];
        int ans = 0;
        int ab = 100;
        for (int i = 0 ; i < n ; i++) {
            p[i] = sc.nextInt();
        }
        for (int i = -100 ; i <= 101 ; i++) {
            boolean flg = true;
            for (int j = 0 ; j < n ; j++) {
                if (i == p[j]) {
                    flg = false;
                }
            }

            if (flg) {
                if (Math.abs(i - x) < ab) {
                    ans = i;
                    ab = Math.abs(i - x);
                }
            }
        }
        System.out.println(ans);
    }

} public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int n = sc.nextInt();
        int[] p = new int[n];
        int ans = 0;
        int ab = 100;
        for (int i = 0 ; i < n ; i++) {
            p[i] = sc.nextInt();
        }
        for (int i = -100 ; i <= 101 ; i++) {
            boolean flg = true;
            for (int j = 0 ; j < n ; j++) {
                if (i == p[j]) {
                    flg = false;
                }
            }

            if (flg) {
                if (Math.abs(i - x) < ab) {
                    ans = i;
                    ab = Math.abs(i - x);
                }
            }
        }
        System.out.println(ans);
    }

} Main

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int n = sc.nextInt();
        int[] p = new int[n];
        int ans = 0;
        int ab = 100;
        for (int i = 0 ; i < n ; i++) {
            p[i] = sc.nextInt();
        }
        for (int i = -100 ; i <= 101 ; i++) {
            boolean flg = true;
            for (int j = 0 ; j < n ; j++) {
                if (i == p[j]) {
                    flg = false;
                }
            }

            if (flg) {
                if (Math.abs(i - x) < ab) {
                    ans = i;
                    ab = Math.abs(i - x);
                }
            }
        }
        System.out.println(ans);
    }

}
