import java.util.*;

class Main {
  public static void main(String args[]) {
      Scanner sc = new Scanner(System.in);
    //int 整数
    int x = sc.nextInt();
    //長さ
    int n = sc.nextInt();
    int minDiff = x;
    int pNot[] = new int[102];
    int ans = 0;
    
    for(int i = 0; i <= 101;i++)
      pNot[i] = 1;
    
    
    for(int i = 0; i < n; i++)
      pNot[sc.nextInt()] = 0;
    
    
    for(int i = 0;i <= 101; i++)
      if(pNot[i] == 1)
        if(minDiff > Math.abs(x - i)){
          minDiff = Math.abs(x - i);
          ans = i;
        }
      
    
    System.out.println(ans);
  }
} import java.util.*; util.* java class Main {
  public static void main(String args[]) {
      Scanner sc = new Scanner(System.in);
    //int 整数
    int x = sc.nextInt();
    //長さ
    int n = sc.nextInt();
    int minDiff = x;
    int pNot[] = new int[102];
    int ans = 0;
    
    for(int i = 0; i <= 101;i++)
      pNot[i] = 1;
    
    
    for(int i = 0; i < n; i++)
      pNot[sc.nextInt()] = 0;
    
    
    for(int i = 0;i <= 101; i++)
      if(pNot[i] == 1)
        if(minDiff > Math.abs(x - i)){
          minDiff = Math.abs(x - i);
          ans = i;
        }
      
    
    System.out.println(ans);
  }
} Main public static void main(String args[]) {
      Scanner sc = new Scanner(System.in);
    //int 整数
    int x = sc.nextInt();
    //長さ
    int n = sc.nextInt();
    int minDiff = x;
    int pNot[] = new int[102];
    int ans = 0;
    
    for(int i = 0; i <= 101;i++)
      pNot[i] = 1;
    
    
    for(int i = 0; i < n; i++)
      pNot[sc.nextInt()] = 0;
    
    
    for(int i = 0;i <= 101; i++)
      if(pNot[i] == 1)
        if(minDiff > Math.abs(x - i)){
          minDiff = Math.abs(x - i);
          ans = i;
        }
      
    
    System.out.println(ans);
  } main {
      Scanner sc = new Scanner(System.in);
    //int 整数
    int x = sc.nextInt();
    //長さ
    int n = sc.nextInt();
    int minDiff = x;
    int pNot[] = new int[102];
    int ans = 0;
    
    for(int i = 0; i <= 101;i++)
      pNot[i] = 1;
    
    
    for(int i = 0; i < n; i++)
      pNot[sc.nextInt()] = 0;
    
    
    for(int i = 0;i <= 101; i++)
      if(pNot[i] == 1)
        if(minDiff > Math.abs(x - i)){
          minDiff = Math.abs(x - i);
          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 n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int minDiff = x; minDiff x int pNot[] = new int[102]; pNot new int[102] 102 int ans = 0; ans 0 for(int i = 0; i <= 101;i++)
      pNot[i] = 1; int i = 0; int i = 0; i 0 i <= 101 i 101 i++ i++ i pNot[i] = 1; pNot[i] = 1 pNot[i] pNot i 1 for(int i = 0; i < n; i++)
      pNot[sc.nextInt()] = 0; int i = 0; int i = 0; i 0 i < n i n i++ i++ i pNot[sc.nextInt()] = 0; pNot[sc.nextInt()] = 0 pNot[sc.nextInt()] pNot sc.nextInt() sc.nextInt sc 0 for(int i = 0;i <= 101; i++)
      if(pNot[i] == 1)
        if(minDiff > Math.abs(x - i)){
          minDiff = Math.abs(x - i);
          ans = i;
        } int i = 0; int i = 0; i 0 i <= 101 i 101 i++ i++ i if(pNot[i] == 1)
        if(minDiff > Math.abs(x - i)){
          minDiff = Math.abs(x - i);
          ans = i;
        } if(pNot[i] == 1)
        if(minDiff > Math.abs(x - i)){
          minDiff = Math.abs(x - i);
          ans = i;
        } pNot[i] == 1 pNot[i] pNot i 1 if(minDiff > Math.abs(x - i)){
          minDiff = Math.abs(x - i);
          ans = i;
        } minDiff > Math.abs(x - i) minDiff Math.abs(x - i) Math.abs Math x - i x i {
          minDiff = Math.abs(x - i);
          ans = i;
        } minDiff = Math.abs(x - i) minDiff Math.abs(x - i) Math.abs Math x - i x i ans = i ans i System.out.println(ans) System.out.println System.out System System.out ans String args[] args
import java.util.*;

class Main {
  public static void main(String args[]) {
      Scanner sc = new Scanner(System.in);
    //int 整数
    int x = sc.nextInt();
    //長さ
    int n = sc.nextInt();
    int minDiff = x;
    int pNot[] = new int[102];
    int ans = 0;
    
    for(int i = 0; i <= 101;i++)
      pNot[i] = 1;
    
    
    for(int i = 0; i < n; i++)
      pNot[sc.nextInt()] = 0;
    
    
    for(int i = 0;i <= 101; i++)
      if(pNot[i] == 1)
        if(minDiff > Math.abs(x - i)){
          minDiff = Math.abs(x - i);
          ans = i;
        }
      
    
    System.out.println(ans);
  }
}
