import java.util.*;
import java.util.stream.*;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int X = sc.nextInt();
    int N = sc.nextInt();
    sc.nextLine();
    List<Integer> P = new ArrayList<>();
    for (int i = 0; i < N; i++) P.add(sc.nextInt());
    int ans = 0;
    int min = X;
    for (int i = 0; i <= 101; i++) {
      if (P.contains(i)) continue;
      if (min > Math.abs(X-i)) {
        ans = i;
        min = Math.abs(X-i);
      }
    }
    System.out.println(ans);
  }
} import java.util.*; util.* java import java.util.stream.*; stream.* java.util class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int X = sc.nextInt();
    int N = sc.nextInt();
    sc.nextLine();
    List<Integer> P = new ArrayList<>();
    for (int i = 0; i < N; i++) P.add(sc.nextInt());
    int ans = 0;
    int min = X;
    for (int i = 0; i <= 101; i++) {
      if (P.contains(i)) continue;
      if (min > Math.abs(X-i)) {
        ans = i;
        min = Math.abs(X-i);
      }
    }
    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();
    sc.nextLine();
    List<Integer> P = new ArrayList<>();
    for (int i = 0; i < N; i++) P.add(sc.nextInt());
    int ans = 0;
    int min = X;
    for (int i = 0; i <= 101; i++) {
      if (P.contains(i)) continue;
      if (min > Math.abs(X-i)) {
        ans = i;
        min = Math.abs(X-i);
      }
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    int X = sc.nextInt();
    int N = sc.nextInt();
    sc.nextLine();
    List<Integer> P = new ArrayList<>();
    for (int i = 0; i < N; i++) P.add(sc.nextInt());
    int ans = 0;
    int min = X;
    for (int i = 0; i <= 101; i++) {
      if (P.contains(i)) continue;
      if (min > Math.abs(X-i)) {
        ans = i;
        min = Math.abs(X-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 sc.nextLine() sc.nextLine sc List<Integer> P = new ArrayList<>(); P new ArrayList<>() for (int i = 0; i < N; i++) P.add(sc.nextInt()); int i = 0; int i = 0; i 0 i < N i N i++ i++ i P.add(sc.nextInt()); P.add(sc.nextInt()) P.add P sc.nextInt() sc.nextInt sc int ans = 0; ans 0 int min = X; min X for (int i = 0; i <= 101; i++) {
      if (P.contains(i)) continue;
      if (min > Math.abs(X-i)) {
        ans = i;
        min = Math.abs(X-i);
      }
    } int i = 0; int i = 0; i 0 i <= 101 i 101 i++ i++ i {
      if (P.contains(i)) continue;
      if (min > Math.abs(X-i)) {
        ans = i;
        min = Math.abs(X-i);
      }
    } {
      if (P.contains(i)) continue;
      if (min > Math.abs(X-i)) {
        ans = i;
        min = Math.abs(X-i);
      }
    } if (P.contains(i)) continue; P.contains(i) P.contains P i continue; if (min > Math.abs(X-i)) {
        ans = i;
        min = Math.abs(X-i);
      } min > Math.abs(X-i) min Math.abs(X-i) Math.abs Math X-i X i {
        ans = i;
        min = Math.abs(X-i);
      } ans = i ans i min = Math.abs(X-i) min Math.abs(X-i) Math.abs Math X-i X i System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;
import java.util.stream.*;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int X = sc.nextInt();
    int N = sc.nextInt();
    sc.nextLine();
    List<Integer> P = new ArrayList<>();
    for (int i = 0; i < N; i++) P.add(sc.nextInt());
    int ans = 0;
    int min = X;
    for (int i = 0; i <= 101; i++) {
      if (P.contains(i)) continue;
      if (min > Math.abs(X-i)) {
        ans = i;
        min = Math.abs(X-i);
      }
    }
    System.out.println(ans);
  }
}