import java.util.Scanner;

/**
 * Main
 */
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int X = sc.nextInt();
        int N = sc.nextInt();
        int[] p = new int[N];
        int[] q = new int[102];
        for(int i=0; i<N; i++){
            p[i] = sc.nextInt();
            q[p[i]] = 1; 
        }
        int minDif = 1000;
        int ans = X;
        for(int i = 0; i<=101; i++){
            if(q[i] == 0){
                if(Math.abs(X-i) < minDif){
                    ans = i;
                    minDif = Math.abs(X-i);
                }
            }
        }
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int X = sc.nextInt();
        int N = sc.nextInt();
        int[] p = new int[N];
        int[] q = new int[102];
        for(int i=0; i<N; i++){
            p[i] = sc.nextInt();
            q[p[i]] = 1; 
        }
        int minDif = 1000;
        int ans = X;
        for(int i = 0; i<=101; i++){
            if(q[i] == 0){
                if(Math.abs(X-i) < minDif){
                    ans = i;
                    minDif = Math.abs(X-i);
                }
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int X = sc.nextInt();
        int N = sc.nextInt();
        int[] p = new int[N];
        int[] q = new int[102];
        for(int i=0; i<N; i++){
            p[i] = sc.nextInt();
            q[p[i]] = 1; 
        }
        int minDif = 1000;
        int ans = X;
        for(int i = 0; i<=101; i++){
            if(q[i] == 0){
                if(Math.abs(X-i) < minDif){
                    ans = i;
                    minDif = Math.abs(X-i);
                }
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);

        int X = sc.nextInt();
        int N = sc.nextInt();
        int[] p = new int[N];
        int[] q = new int[102];
        for(int i=0; i<N; i++){
            p[i] = sc.nextInt();
            q[p[i]] = 1; 
        }
        int minDif = 1000;
        int ans = X;
        for(int i = 0; i<=101; i++){
            if(q[i] == 0){
                if(Math.abs(X-i) < minDif){
                    ans = i;
                    minDif = Math.abs(X-i);
                }
            }
        }
        System.out.println(ans);
    } 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[] q = new int[102]; q new int[102] 102 for(int i=0; i<N; i++){
            p[i] = sc.nextInt();
            q[p[i]] = 1; 
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            p[i] = sc.nextInt();
            q[p[i]] = 1; 
        } {
            p[i] = sc.nextInt();
            q[p[i]] = 1; 
        } p[i] = sc.nextInt() p[i] p i sc.nextInt() sc.nextInt sc q[p[i]] = 1 q[p[i]] q p[i] p i 1 int minDif = 1000; minDif 1000 int ans = X; ans X for(int i = 0; i<=101; i++){
            if(q[i] == 0){
                if(Math.abs(X-i) < minDif){
                    ans = i;
                    minDif = Math.abs(X-i);
                }
            }
        } int i = 0; int i = 0; i 0 i<=101 i 101 i++ i++ i {
            if(q[i] == 0){
                if(Math.abs(X-i) < minDif){
                    ans = i;
                    minDif = Math.abs(X-i);
                }
            }
        } {
            if(q[i] == 0){
                if(Math.abs(X-i) < minDif){
                    ans = i;
                    minDif = Math.abs(X-i);
                }
            }
        } if(q[i] == 0){
                if(Math.abs(X-i) < minDif){
                    ans = i;
                    minDif = Math.abs(X-i);
                }
            } q[i] == 0 q[i] q i 0 {
                if(Math.abs(X-i) < minDif){
                    ans = i;
                    minDif = Math.abs(X-i);
                }
            } if(Math.abs(X-i) < minDif){
                    ans = i;
                    minDif = Math.abs(X-i);
                } Math.abs(X-i) < minDif Math.abs(X-i) Math.abs Math X-i X i minDif {
                    ans = i;
                    minDif = Math.abs(X-i);
                } ans = i ans i minDif = Math.abs(X-i) minDif Math.abs(X-i) Math.abs Math X-i X i 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) {
        Scanner sc = new Scanner(System.in);

        int X = sc.nextInt();
        int N = sc.nextInt();
        int[] p = new int[N];
        int[] q = new int[102];
        for(int i=0; i<N; i++){
            p[i] = sc.nextInt();
            q[p[i]] = 1; 
        }
        int minDif = 1000;
        int ans = X;
        for(int i = 0; i<=101; i++){
            if(q[i] == 0){
                if(Math.abs(X-i) < minDif){
                    ans = i;
                    minDif = Math.abs(X-i);
                }
            }
        }
        System.out.println(ans);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int X = sc.nextInt();
        int N = sc.nextInt();
        int[] p = new int[N];
        int[] q = new int[102];
        for(int i=0; i<N; i++){
            p[i] = sc.nextInt();
            q[p[i]] = 1; 
        }
        int minDif = 1000;
        int ans = X;
        for(int i = 0; i<=101; i++){
            if(q[i] == 0){
                if(Math.abs(X-i) < minDif){
                    ans = i;
                    minDif = Math.abs(X-i);
                }
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.Scanner;

/**
 * Main
 */
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int X = sc.nextInt();
        int N = sc.nextInt();
        int[] p = new int[N];
        int[] q = new int[102];
        for(int i=0; i<N; i++){
            p[i] = sc.nextInt();
            q[p[i]] = 1; 
        }
        int minDif = 1000;
        int ans = X;
        for(int i = 0; i<=101; i++){
            if(q[i] == 0){
                if(Math.abs(X-i) < minDif){
                    ans = i;
                    minDif = Math.abs(X-i);
                }
            }
        }
        System.out.println(ans);
    }
}