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();
    HashSet<Integer> set = new HashSet<Integer>();
    
    for(int i=0; i<N; i++){
      set.add(sc.nextInt());
    }
    
    int ans = X;
    int min = Integer.MAX_VALUE;
    for(int i = 0; i<=200; i++){
      if(set.contains(i)){
        continue;
      }
      int gap = Math.abs(X - i);
      if(gap < min){
        ans = i;
        min = gap;
      }
    }
    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 N = sc.nextInt();
    HashSet<Integer> set = new HashSet<Integer>();
    
    for(int i=0; i<N; i++){
      set.add(sc.nextInt());
    }
    
    int ans = X;
    int min = Integer.MAX_VALUE;
    for(int i = 0; i<=200; i++){
      if(set.contains(i)){
        continue;
      }
      int gap = Math.abs(X - i);
      if(gap < min){
        ans = i;
        min = gap;
      }
    }
    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();
    HashSet<Integer> set = new HashSet<Integer>();
    
    for(int i=0; i<N; i++){
      set.add(sc.nextInt());
    }
    
    int ans = X;
    int min = Integer.MAX_VALUE;
    for(int i = 0; i<=200; i++){
      if(set.contains(i)){
        continue;
      }
      int gap = Math.abs(X - i);
      if(gap < min){
        ans = i;
        min = gap;
      }
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    int X = sc.nextInt();
    int N = sc.nextInt();
    HashSet<Integer> set = new HashSet<Integer>();
    
    for(int i=0; i<N; i++){
      set.add(sc.nextInt());
    }
    
    int ans = X;
    int min = Integer.MAX_VALUE;
    for(int i = 0; i<=200; i++){
      if(set.contains(i)){
        continue;
      }
      int gap = Math.abs(X - i);
      if(gap < min){
        ans = i;
        min = gap;
      }
    }
    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 HashSet<Integer> set = new HashSet<Integer>(); set new HashSet<Integer>() for(int i=0; i<N; i++){
      set.add(sc.nextInt());
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      set.add(sc.nextInt());
    } {
      set.add(sc.nextInt());
    } set.add(sc.nextInt()) set.add set sc.nextInt() sc.nextInt sc int ans = X; ans X int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for(int i = 0; i<=200; i++){
      if(set.contains(i)){
        continue;
      }
      int gap = Math.abs(X - i);
      if(gap < min){
        ans = i;
        min = gap;
      }
    } int i = 0; int i = 0; i 0 i<=200 i 200 i++ i++ i {
      if(set.contains(i)){
        continue;
      }
      int gap = Math.abs(X - i);
      if(gap < min){
        ans = i;
        min = gap;
      }
    } {
      if(set.contains(i)){
        continue;
      }
      int gap = Math.abs(X - i);
      if(gap < min){
        ans = i;
        min = gap;
      }
    } if(set.contains(i)){
        continue;
      } set.contains(i) set.contains set i {
        continue;
      } continue; int gap = Math.abs(X - i); gap Math.abs(X - i) Math.abs Math X - i X i if(gap < min){
        ans = i;
        min = gap;
      } gap < min gap min {
        ans = i;
        min = gap;
      } ans = i ans i min = gap min gap 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();
    HashSet<Integer> set = new HashSet<Integer>();
    
    for(int i=0; i<N; i++){
      set.add(sc.nextInt());
    }
    
    int ans = X;
    int min = Integer.MAX_VALUE;
    for(int i = 0; i<=200; i++){
      if(set.contains(i)){
        continue;
      }
      int gap = Math.abs(X - i);
      if(gap < min){
        ans = i;
        min = gap;
      }
    }
    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();
    HashSet<Integer> set = new HashSet<Integer>();
    
    for(int i=0; i<N; i++){
      set.add(sc.nextInt());
    }
    
    int ans = X;
    int min = Integer.MAX_VALUE;
    for(int i = 0; i<=200; i++){
      if(set.contains(i)){
        continue;
      }
      int gap = Math.abs(X - i);
      if(gap < min){
        ans = i;
        min = gap;
      }
    }
    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 N = sc.nextInt();
    HashSet<Integer> set = new HashSet<Integer>();
    
    for(int i=0; i<N; i++){
      set.add(sc.nextInt());
    }
    
    int ans = X;
    int min = Integer.MAX_VALUE;
    for(int i = 0; i<=200; i++){
      if(set.contains(i)){
        continue;
      }
      int gap = Math.abs(X - i);
      if(gap < min){
        ans = i;
        min = gap;
      }
    }
    System.out.println(ans);
  }
}
 