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();
    ArrayList<Integer> list = new ArrayList<Integer>();
    for(int i = 0; i < n; i++) {
      int p = sc.nextInt();
      list.add(p);
    }
    int ans = 0;
    int t = x;
    for(int i = 1; i <= 101; i++) {
      if(!list.contains(i)) {
        if(Math.abs(x - i) < t) {
          t = Math.abs(x - i);
          ans = i;
        }
      }
    }
    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();
    ArrayList<Integer> list = new ArrayList<Integer>();
    for(int i = 0; i < n; i++) {
      int p = sc.nextInt();
      list.add(p);
    }
    int ans = 0;
    int t = x;
    for(int i = 1; i <= 101; i++) {
      if(!list.contains(i)) {
        if(Math.abs(x - i) < t) {
          t = Math.abs(x - i);
          ans = 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();
    ArrayList<Integer> list = new ArrayList<Integer>();
    for(int i = 0; i < n; i++) {
      int p = sc.nextInt();
      list.add(p);
    }
    int ans = 0;
    int t = x;
    for(int i = 1; i <= 101; i++) {
      if(!list.contains(i)) {
        if(Math.abs(x - i) < t) {
          t = Math.abs(x - i);
          ans = i;
        }
      }
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int n = sc.nextInt();
    ArrayList<Integer> list = new ArrayList<Integer>();
    for(int i = 0; i < n; i++) {
      int p = sc.nextInt();
      list.add(p);
    }
    int ans = 0;
    int t = x;
    for(int i = 1; i <= 101; i++) {
      if(!list.contains(i)) {
        if(Math.abs(x - i) < t) {
          t = 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 ArrayList<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() for(int i = 0; i < n; i++) {
      int p = sc.nextInt();
      list.add(p);
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      int p = sc.nextInt();
      list.add(p);
    } {
      int p = sc.nextInt();
      list.add(p);
    } int p = sc.nextInt(); p sc.nextInt() sc.nextInt sc list.add(p) list.add list p int ans = 0; ans 0 int t = x; t x for(int i = 1; i <= 101; i++) {
      if(!list.contains(i)) {
        if(Math.abs(x - i) < t) {
          t = Math.abs(x - i);
          ans = i;
        }
      }
    } int i = 1; int i = 1; i 1 i <= 101 i 101 i++ i++ i {
      if(!list.contains(i)) {
        if(Math.abs(x - i) < t) {
          t = Math.abs(x - i);
          ans = i;
        }
      }
    } {
      if(!list.contains(i)) {
        if(Math.abs(x - i) < t) {
          t = Math.abs(x - i);
          ans = i;
        }
      }
    } if(!list.contains(i)) {
        if(Math.abs(x - i) < t) {
          t = Math.abs(x - i);
          ans = i;
        }
      } !list.contains(i) list.contains(i) list.contains list i {
        if(Math.abs(x - i) < t) {
          t = Math.abs(x - i);
          ans = i;
        }
      } if(Math.abs(x - i) < t) {
          t = Math.abs(x - i);
          ans = i;
        } Math.abs(x - i) < t Math.abs(x - i) Math.abs Math x - i x i t {
          t = Math.abs(x - i);
          ans = i;
        } t = Math.abs(x - i) t 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 public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int n = sc.nextInt();
    ArrayList<Integer> list = new ArrayList<Integer>();
    for(int i = 0; i < n; i++) {
      int p = sc.nextInt();
      list.add(p);
    }
    int ans = 0;
    int t = x;
    for(int i = 1; i <= 101; i++) {
      if(!list.contains(i)) {
        if(Math.abs(x - i) < t) {
          t = Math.abs(x - i);
          ans = i;
        }
      }
    }
    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();
    ArrayList<Integer> list = new ArrayList<Integer>();
    for(int i = 0; i < n; i++) {
      int p = sc.nextInt();
      list.add(p);
    }
    int ans = 0;
    int t = x;
    for(int i = 1; i <= 101; i++) {
      if(!list.contains(i)) {
        if(Math.abs(x - i) < t) {
          t = Math.abs(x - i);
          ans = i;
        }
      }
    }
    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();
    ArrayList<Integer> list = new ArrayList<Integer>();
    for(int i = 0; i < n; i++) {
      int p = sc.nextInt();
      list.add(p);
    }
    int ans = 0;
    int t = x;
    for(int i = 1; i <= 101; i++) {
      if(!list.contains(i)) {
        if(Math.abs(x - i) < t) {
          t = Math.abs(x - i);
          ans = i;
        }
      }
    }
    System.out.println(ans);
  }
}