
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int n = sc.nextInt();
    int max = 105;
    Set<Integer> set = new HashSet<>();
    for (int i = 0; i < n; i++) {
      set.add(sc.nextInt());
    }

    int ans = -1;
    if (set.isEmpty()) {
      ans = x;
    } else {
      for (int i = 0; i <= max; i++) {
        if (!set.contains(i) && Math.abs(ans - x) > Math.abs(i - x)) {
          ans = i;
        }
      }
    }
    System.out.println(ans);
    System.out.flush();
    sc.close();
  }
} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set 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 max = 105;
    Set<Integer> set = new HashSet<>();
    for (int i = 0; i < n; i++) {
      set.add(sc.nextInt());
    }

    int ans = -1;
    if (set.isEmpty()) {
      ans = x;
    } else {
      for (int i = 0; i <= max; i++) {
        if (!set.contains(i) && Math.abs(ans - x) > Math.abs(i - x)) {
          ans = i;
        }
      }
    }
    System.out.println(ans);
    System.out.flush();
    sc.close();
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int n = sc.nextInt();
    int max = 105;
    Set<Integer> set = new HashSet<>();
    for (int i = 0; i < n; i++) {
      set.add(sc.nextInt());
    }

    int ans = -1;
    if (set.isEmpty()) {
      ans = x;
    } else {
      for (int i = 0; i <= max; i++) {
        if (!set.contains(i) && Math.abs(ans - x) > Math.abs(i - x)) {
          ans = i;
        }
      }
    }
    System.out.println(ans);
    System.out.flush();
    sc.close();
  } main {
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int n = sc.nextInt();
    int max = 105;
    Set<Integer> set = new HashSet<>();
    for (int i = 0; i < n; i++) {
      set.add(sc.nextInt());
    }

    int ans = -1;
    if (set.isEmpty()) {
      ans = x;
    } else {
      for (int i = 0; i <= max; i++) {
        if (!set.contains(i) && Math.abs(ans - x) > Math.abs(i - x)) {
          ans = i;
        }
      }
    }
    System.out.println(ans);
    System.out.flush();
    sc.close();
  } 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 max = 105; max 105 Set<Integer> set = new HashSet<>(); set new HashSet<>() 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 = -1; ans -1 1 if (set.isEmpty()) {
      ans = x;
    } else {
      for (int i = 0; i <= max; i++) {
        if (!set.contains(i) && Math.abs(ans - x) > Math.abs(i - x)) {
          ans = i;
        }
      }
    } set.isEmpty() set.isEmpty set {
      ans = x;
    } ans = x ans x {
      for (int i = 0; i <= max; i++) {
        if (!set.contains(i) && Math.abs(ans - x) > Math.abs(i - x)) {
          ans = i;
        }
      }
    } for (int i = 0; i <= max; i++) {
        if (!set.contains(i) && Math.abs(ans - x) > Math.abs(i - x)) {
          ans = i;
        }
      } int i = 0; int i = 0; i 0 i <= max i max i++ i++ i {
        if (!set.contains(i) && Math.abs(ans - x) > Math.abs(i - x)) {
          ans = i;
        }
      } {
        if (!set.contains(i) && Math.abs(ans - x) > Math.abs(i - x)) {
          ans = i;
        }
      } if (!set.contains(i) && Math.abs(ans - x) > Math.abs(i - x)) {
          ans = i;
        } !set.contains(i) && Math.abs(ans - x) > Math.abs(i - x) !set.contains(i) set.contains(i) set.contains set i Math.abs(ans - x) > Math.abs(i - x) Math.abs(ans - x) Math.abs Math ans - x ans x Math.abs(i - x) Math.abs Math i - x i x {
          ans = i;
        } ans = i ans i System.out.println(ans) System.out.println System.out System System.out ans System.out.flush() System.out.flush System.out System System.out sc.close() sc.close sc 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 max = 105;
    Set<Integer> set = new HashSet<>();
    for (int i = 0; i < n; i++) {
      set.add(sc.nextInt());
    }

    int ans = -1;
    if (set.isEmpty()) {
      ans = x;
    } else {
      for (int i = 0; i <= max; i++) {
        if (!set.contains(i) && Math.abs(ans - x) > Math.abs(i - x)) {
          ans = i;
        }
      }
    }
    System.out.println(ans);
    System.out.flush();
    sc.close();
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int n = sc.nextInt();
    int max = 105;
    Set<Integer> set = new HashSet<>();
    for (int i = 0; i < n; i++) {
      set.add(sc.nextInt());
    }

    int ans = -1;
    if (set.isEmpty()) {
      ans = x;
    } else {
      for (int i = 0; i <= max; i++) {
        if (!set.contains(i) && Math.abs(ans - x) > Math.abs(i - x)) {
          ans = i;
        }
      }
    }
    System.out.println(ans);
    System.out.flush();
    sc.close();
  }
} Main

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int n = sc.nextInt();
    int max = 105;
    Set<Integer> set = new HashSet<>();
    for (int i = 0; i < n; i++) {
      set.add(sc.nextInt());
    }

    int ans = -1;
    if (set.isEmpty()) {
      ans = x;
    } else {
      for (int i = 0; i <= max; i++) {
        if (!set.contains(i) && Math.abs(ans - x) > Math.abs(i - x)) {
          ans = i;
        }
      }
    }
    System.out.println(ans);
    System.out.flush();
    sc.close();
  }
}
