import java.util.Scanner;

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[] d = new int[102];
        for(int i=0; i<=101; i++){
            d[i]=i;
        }
        
        for(int i = 0; i<n;i++) {
        	p[i] = sc.nextInt();
        	d[p[i]]=-1;
        }
        
        
        
        
        int min = 99999;
        int ans = 0;
        if(n==0) ans = x;
        for(int i=0; i<=101; i++){
            if(d[i] != -1) {
            	if(Math.abs(i-x) < min ) {
            		ans = i;
            		min = Math.abs(i-x);
            	}
            }
            
        }
        
        
        System.out.print(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[] d = new int[102];
        for(int i=0; i<=101; i++){
            d[i]=i;
        }
        
        for(int i = 0; i<n;i++) {
        	p[i] = sc.nextInt();
        	d[p[i]]=-1;
        }
        
        
        
        
        int min = 99999;
        int ans = 0;
        if(n==0) ans = x;
        for(int i=0; i<=101; i++){
            if(d[i] != -1) {
            	if(Math.abs(i-x) < min ) {
            		ans = i;
            		min = Math.abs(i-x);
            	}
            }
            
        }
        
        
        System.out.print(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[] d = new int[102];
        for(int i=0; i<=101; i++){
            d[i]=i;
        }
        
        for(int i = 0; i<n;i++) {
        	p[i] = sc.nextInt();
        	d[p[i]]=-1;
        }
        
        
        
        
        int min = 99999;
        int ans = 0;
        if(n==0) ans = x;
        for(int i=0; i<=101; i++){
            if(d[i] != -1) {
            	if(Math.abs(i-x) < min ) {
            		ans = i;
            		min = Math.abs(i-x);
            	}
            }
            
        }
        
        
        System.out.print(ans);
        
	} main {
		Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int n = sc.nextInt();
        int[] p = new int[n];
        int[] d = new int[102];
        for(int i=0; i<=101; i++){
            d[i]=i;
        }
        
        for(int i = 0; i<n;i++) {
        	p[i] = sc.nextInt();
        	d[p[i]]=-1;
        }
        
        
        
        
        int min = 99999;
        int ans = 0;
        if(n==0) ans = x;
        for(int i=0; i<=101; i++){
            if(d[i] != -1) {
            	if(Math.abs(i-x) < min ) {
            		ans = i;
            		min = Math.abs(i-x);
            	}
            }
            
        }
        
        
        System.out.print(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[] d = new int[102]; d new int[102] 102 for(int i=0; i<=101; i++){
            d[i]=i;
        } int i=0; int i=0; i 0 i<=101 i 101 i++ i++ i {
            d[i]=i;
        } {
            d[i]=i;
        } d[i]=i d[i] d i i for(int i = 0; i<n;i++) {
        	p[i] = sc.nextInt();
        	d[p[i]]=-1;
        } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
        	p[i] = sc.nextInt();
        	d[p[i]]=-1;
        } {
        	p[i] = sc.nextInt();
        	d[p[i]]=-1;
        } p[i] = sc.nextInt() p[i] p i sc.nextInt() sc.nextInt sc d[p[i]]=-1 d[p[i]] d p[i] p i -1 1 int min = 99999; min 99999 int ans = 0; ans 0 if(n==0) ans = x; n==0 n 0 ans = x ans x for(int i=0; i<=101; i++){
            if(d[i] != -1) {
            	if(Math.abs(i-x) < min ) {
            		ans = i;
            		min = Math.abs(i-x);
            	}
            }
            
        } int i=0; int i=0; i 0 i<=101 i 101 i++ i++ i {
            if(d[i] != -1) {
            	if(Math.abs(i-x) < min ) {
            		ans = i;
            		min = Math.abs(i-x);
            	}
            }
            
        } {
            if(d[i] != -1) {
            	if(Math.abs(i-x) < min ) {
            		ans = i;
            		min = Math.abs(i-x);
            	}
            }
            
        } if(d[i] != -1) {
            	if(Math.abs(i-x) < min ) {
            		ans = i;
            		min = Math.abs(i-x);
            	}
            } d[i] != -1 d[i] d i -1 1 {
            	if(Math.abs(i-x) < min ) {
            		ans = i;
            		min = Math.abs(i-x);
            	}
            } if(Math.abs(i-x) < min ) {
            		ans = i;
            		min = Math.abs(i-x);
            	} Math.abs(i-x) < min Math.abs(i-x) Math.abs Math i-x i x min {
            		ans = i;
            		min = Math.abs(i-x);
            	} ans = i ans i min = Math.abs(i-x) min Math.abs(i-x) Math.abs Math i-x i x System.out.print(ans) System.out.print 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[] d = new int[102];
        for(int i=0; i<=101; i++){
            d[i]=i;
        }
        
        for(int i = 0; i<n;i++) {
        	p[i] = sc.nextInt();
        	d[p[i]]=-1;
        }
        
        
        
        
        int min = 99999;
        int ans = 0;
        if(n==0) ans = x;
        for(int i=0; i<=101; i++){
            if(d[i] != -1) {
            	if(Math.abs(i-x) < min ) {
            		ans = i;
            		min = Math.abs(i-x);
            	}
            }
            
        }
        
        
        System.out.print(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[] d = new int[102];
        for(int i=0; i<=101; i++){
            d[i]=i;
        }
        
        for(int i = 0; i<n;i++) {
        	p[i] = sc.nextInt();
        	d[p[i]]=-1;
        }
        
        
        
        
        int min = 99999;
        int ans = 0;
        if(n==0) ans = x;
        for(int i=0; i<=101; i++){
            if(d[i] != -1) {
            	if(Math.abs(i-x) < min ) {
            		ans = i;
            		min = Math.abs(i-x);
            	}
            }
            
        }
        
        
        System.out.print(ans);
        
	}
} Main
import java.util.Scanner;

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[] d = new int[102];
        for(int i=0; i<=101; i++){
            d[i]=i;
        }
        
        for(int i = 0; i<n;i++) {
        	p[i] = sc.nextInt();
        	d[p[i]]=-1;
        }
        
        
        
        
        int min = 99999;
        int ans = 0;
        if(n==0) ans = x;
        for(int i=0; i<=101; i++){
            if(d[i] != -1) {
            	if(Math.abs(i-x) < min ) {
            		ans = i;
            		min = Math.abs(i-x);
            	}
            }
            
        }
        
        
        System.out.print(ans);
        
	}
}