import 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 min = 200;
      	int pos = 0;
      	boolean ans = false;
		for(int i=0;i<n;i++){
          p[i] = sc.nextInt();
        }
      	for(int i=0;i<101+1;i++){
          ans = true;
          for(int j=0;j<n;j++){
            if( p[j] == i ){
              ans = false;
            }
          }
          if( ans ){
            if( Math.abs(x - i) < min ){
              min = Math.abs(x - i);
              pos = i;
            }
          }
        }
      System.out.println(pos);
	}
} 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 n = sc.nextInt();
      	int[] p = new int[n];
      	int min = 200;
      	int pos = 0;
      	boolean ans = false;
		for(int i=0;i<n;i++){
          p[i] = sc.nextInt();
        }
      	for(int i=0;i<101+1;i++){
          ans = true;
          for(int j=0;j<n;j++){
            if( p[j] == i ){
              ans = false;
            }
          }
          if( ans ){
            if( Math.abs(x - i) < min ){
              min = Math.abs(x - i);
              pos = i;
            }
          }
        }
      System.out.println(pos);
	}
} 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 min = 200;
      	int pos = 0;
      	boolean ans = false;
		for(int i=0;i<n;i++){
          p[i] = sc.nextInt();
        }
      	for(int i=0;i<101+1;i++){
          ans = true;
          for(int j=0;j<n;j++){
            if( p[j] == i ){
              ans = false;
            }
          }
          if( ans ){
            if( Math.abs(x - i) < min ){
              min = Math.abs(x - i);
              pos = i;
            }
          }
        }
      System.out.println(pos);
	} main {
		Scanner sc = new Scanner(System.in);
      	int x = sc.nextInt();
      	int n = sc.nextInt();
      	int[] p = new int[n];
      	int min = 200;
      	int pos = 0;
      	boolean ans = false;
		for(int i=0;i<n;i++){
          p[i] = sc.nextInt();
        }
      	for(int i=0;i<101+1;i++){
          ans = true;
          for(int j=0;j<n;j++){
            if( p[j] == i ){
              ans = false;
            }
          }
          if( ans ){
            if( Math.abs(x - i) < min ){
              min = Math.abs(x - i);
              pos = i;
            }
          }
        }
      System.out.println(pos);
	} 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 min = 200; min 200 int pos = 0; pos 0 boolean ans = false; ans false 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=0;i<101+1;i++){
          ans = true;
          for(int j=0;j<n;j++){
            if( p[j] == i ){
              ans = false;
            }
          }
          if( ans ){
            if( Math.abs(x - i) < min ){
              min = Math.abs(x - i);
              pos = i;
            }
          }
        } int i=0; int i=0; i 0 i<101+1 i 101+1 101 1 i++ i++ i {
          ans = true;
          for(int j=0;j<n;j++){
            if( p[j] == i ){
              ans = false;
            }
          }
          if( ans ){
            if( Math.abs(x - i) < min ){
              min = Math.abs(x - i);
              pos = i;
            }
          }
        } {
          ans = true;
          for(int j=0;j<n;j++){
            if( p[j] == i ){
              ans = false;
            }
          }
          if( ans ){
            if( Math.abs(x - i) < min ){
              min = Math.abs(x - i);
              pos = i;
            }
          }
        } ans = true ans true for(int j=0;j<n;j++){
            if( p[j] == i ){
              ans = false;
            }
          } int j=0; int j=0; j 0 j<n j n j++ j++ j {
            if( p[j] == i ){
              ans = false;
            }
          } {
            if( p[j] == i ){
              ans = false;
            }
          } if( p[j] == i ){
              ans = false;
            } p[j] == i p[j] p j i {
              ans = false;
            } ans = false ans false if( ans ){
            if( Math.abs(x - i) < min ){
              min = Math.abs(x - i);
              pos = i;
            }
          } ans {
            if( Math.abs(x - i) < min ){
              min = Math.abs(x - i);
              pos = i;
            }
          } if( Math.abs(x - i) < min ){
              min = Math.abs(x - i);
              pos = i;
            } Math.abs(x - i) < min Math.abs(x - i) Math.abs Math x - i x i min {
              min = Math.abs(x - i);
              pos = i;
            } min = Math.abs(x - i) min Math.abs(x - i) Math.abs Math x - i x i pos = i pos i System.out.println(pos) System.out.println System.out System System.out pos 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 min = 200;
      	int pos = 0;
      	boolean ans = false;
		for(int i=0;i<n;i++){
          p[i] = sc.nextInt();
        }
      	for(int i=0;i<101+1;i++){
          ans = true;
          for(int j=0;j<n;j++){
            if( p[j] == i ){
              ans = false;
            }
          }
          if( ans ){
            if( Math.abs(x - i) < min ){
              min = Math.abs(x - i);
              pos = i;
            }
          }
        }
      System.out.println(pos);
	}
} 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 min = 200;
      	int pos = 0;
      	boolean ans = false;
		for(int i=0;i<n;i++){
          p[i] = sc.nextInt();
        }
      	for(int i=0;i<101+1;i++){
          ans = true;
          for(int j=0;j<n;j++){
            if( p[j] == i ){
              ans = false;
            }
          }
          if( ans ){
            if( Math.abs(x - i) < min ){
              min = Math.abs(x - i);
              pos = i;
            }
          }
        }
      System.out.println(pos);
	}
} Main
import 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 min = 200;
      	int pos = 0;
      	boolean ans = false;
		for(int i=0;i<n;i++){
          p[i] = sc.nextInt();
        }
      	for(int i=0;i<101+1;i++){
          ans = true;
          for(int j=0;j<n;j++){
            if( p[j] == i ){
              ans = false;
            }
          }
          if( ans ){
            if( Math.abs(x - i) < min ){
              min = Math.abs(x - i);
              pos = i;
            }
          }
        }
      System.out.println(pos);
	}
}