import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int X = sc.nextInt();
      	int Y = sc.nextInt();
      	int[] num = new int[Y];
      	int dist = 10000;
      	int ans = X;
      	for(int i=0;i<Y;i++){
          num[i] = sc.nextInt();
        }
      	Arrays.sort(num);
      	int pos = 0;
      	for(int i=-101;i<102;i++){
          if( pos < Y && num[pos] == i ){
            pos++;
            continue;
          }
          if( Math.abs( i-X ) < dist ){
            dist = Math.abs( i-X );
            ans = i;
          }
        }
      System.out.println(ans);    	
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int X = sc.nextInt();
      	int Y = sc.nextInt();
      	int[] num = new int[Y];
      	int dist = 10000;
      	int ans = X;
      	for(int i=0;i<Y;i++){
          num[i] = sc.nextInt();
        }
      	Arrays.sort(num);
      	int pos = 0;
      	for(int i=-101;i<102;i++){
          if( pos < Y && num[pos] == i ){
            pos++;
            continue;
          }
          if( Math.abs( i-X ) < dist ){
            dist = Math.abs( i-X );
            ans = i;
          }
        }
      System.out.println(ans);    	
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int X = sc.nextInt();
      	int Y = sc.nextInt();
      	int[] num = new int[Y];
      	int dist = 10000;
      	int ans = X;
      	for(int i=0;i<Y;i++){
          num[i] = sc.nextInt();
        }
      	Arrays.sort(num);
      	int pos = 0;
      	for(int i=-101;i<102;i++){
          if( pos < Y && num[pos] == i ){
            pos++;
            continue;
          }
          if( Math.abs( i-X ) < dist ){
            dist = Math.abs( i-X );
            ans = i;
          }
        }
      System.out.println(ans);    	
	} main {
		Scanner sc = new Scanner(System.in);
      	int X = sc.nextInt();
      	int Y = sc.nextInt();
      	int[] num = new int[Y];
      	int dist = 10000;
      	int ans = X;
      	for(int i=0;i<Y;i++){
          num[i] = sc.nextInt();
        }
      	Arrays.sort(num);
      	int pos = 0;
      	for(int i=-101;i<102;i++){
          if( pos < Y && num[pos] == i ){
            pos++;
            continue;
          }
          if( Math.abs( i-X ) < dist ){
            dist = Math.abs( i-X );
            ans = 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 Y = sc.nextInt(); Y sc.nextInt() sc.nextInt sc int[] num = new int[Y]; num new int[Y] Y int dist = 10000; dist 10000 int ans = X; ans X for(int i=0;i<Y;i++){
          num[i] = sc.nextInt();
        } int i=0; int i=0; i 0 i<Y i Y i++ i++ i {
          num[i] = sc.nextInt();
        } {
          num[i] = sc.nextInt();
        } num[i] = sc.nextInt() num[i] num i sc.nextInt() sc.nextInt sc Arrays.sort(num) Arrays.sort Arrays num int pos = 0; pos 0 for(int i=-101;i<102;i++){
          if( pos < Y && num[pos] == i ){
            pos++;
            continue;
          }
          if( Math.abs( i-X ) < dist ){
            dist = Math.abs( i-X );
            ans = i;
          }
        } int i=-101; int i=-101; i -101 101 i<102 i 102 i++ i++ i {
          if( pos < Y && num[pos] == i ){
            pos++;
            continue;
          }
          if( Math.abs( i-X ) < dist ){
            dist = Math.abs( i-X );
            ans = i;
          }
        } {
          if( pos < Y && num[pos] == i ){
            pos++;
            continue;
          }
          if( Math.abs( i-X ) < dist ){
            dist = Math.abs( i-X );
            ans = i;
          }
        } if( pos < Y && num[pos] == i ){
            pos++;
            continue;
          } pos < Y && num[pos] == i pos < Y pos Y num[pos] == i num[pos] num pos i {
            pos++;
            continue;
          } pos++ pos continue; if( Math.abs( i-X ) < dist ){
            dist = Math.abs( i-X );
            ans = i;
          } Math.abs( i-X ) < dist Math.abs( i-X ) Math.abs Math i-X i X dist {
            dist = Math.abs( i-X );
            ans = i;
          } dist = Math.abs( i-X ) dist Math.abs( i-X ) Math.abs Math i-X i X ans = i ans 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 Y = sc.nextInt();
      	int[] num = new int[Y];
      	int dist = 10000;
      	int ans = X;
      	for(int i=0;i<Y;i++){
          num[i] = sc.nextInt();
        }
      	Arrays.sort(num);
      	int pos = 0;
      	for(int i=-101;i<102;i++){
          if( pos < Y && num[pos] == i ){
            pos++;
            continue;
          }
          if( Math.abs( i-X ) < dist ){
            dist = Math.abs( i-X );
            ans = 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 Y = sc.nextInt();
      	int[] num = new int[Y];
      	int dist = 10000;
      	int ans = X;
      	for(int i=0;i<Y;i++){
          num[i] = sc.nextInt();
        }
      	Arrays.sort(num);
      	int pos = 0;
      	for(int i=-101;i<102;i++){
          if( pos < Y && num[pos] == i ){
            pos++;
            continue;
          }
          if( Math.abs( i-X ) < dist ){
            dist = Math.abs( i-X );
            ans = i;
          }
        }
      System.out.println(ans);    	
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int X = sc.nextInt();
      	int Y = sc.nextInt();
      	int[] num = new int[Y];
      	int dist = 10000;
      	int ans = X;
      	for(int i=0;i<Y;i++){
          num[i] = sc.nextInt();
        }
      	Arrays.sort(num);
      	int pos = 0;
      	for(int i=-101;i<102;i++){
          if( pos < Y && num[pos] == i ){
            pos++;
            continue;
          }
          if( Math.abs( i-X ) < dist ){
            dist = Math.abs( i-X );
            ans = i;
          }
        }
      System.out.println(ans);    	
	}
}