import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        int X = scanner.nextInt();
        int N = scanner.nextInt();
        HashSet<Integer> set1 = new HashSet<Integer>();
        HashSet<Integer> set2 = new HashSet<Integer>();
        int sa = 1000;
        int num = 0;
        
        for(int i=0; i<N; i++){
            int n = scanner.nextInt();
            set1.add(n);
        }
        
        for(int i=0; i<100; i++){
            if(!set1.contains(i+1)){
                set2.add(i+1);
            }
        }
        
        for(int i: set2){
            if(Math.abs(i-X)<sa){
                sa = Math.abs(i-X);
                num = i;
            }
        }
        
        if(X<=50){
            if(X<=Math.abs(num-X)){
                System.out.println(0);
            }else{
                System.out.println(num);
            }
        }else{
            if(101-X<Math.abs(num-X)){
                System.out.println(101);
            }else{
                System.out.println(num);
            }
        }
        
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        int X = scanner.nextInt();
        int N = scanner.nextInt();
        HashSet<Integer> set1 = new HashSet<Integer>();
        HashSet<Integer> set2 = new HashSet<Integer>();
        int sa = 1000;
        int num = 0;
        
        for(int i=0; i<N; i++){
            int n = scanner.nextInt();
            set1.add(n);
        }
        
        for(int i=0; i<100; i++){
            if(!set1.contains(i+1)){
                set2.add(i+1);
            }
        }
        
        for(int i: set2){
            if(Math.abs(i-X)<sa){
                sa = Math.abs(i-X);
                num = i;
            }
        }
        
        if(X<=50){
            if(X<=Math.abs(num-X)){
                System.out.println(0);
            }else{
                System.out.println(num);
            }
        }else{
            if(101-X<Math.abs(num-X)){
                System.out.println(101);
            }else{
                System.out.println(num);
            }
        }
        
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        int X = scanner.nextInt();
        int N = scanner.nextInt();
        HashSet<Integer> set1 = new HashSet<Integer>();
        HashSet<Integer> set2 = new HashSet<Integer>();
        int sa = 1000;
        int num = 0;
        
        for(int i=0; i<N; i++){
            int n = scanner.nextInt();
            set1.add(n);
        }
        
        for(int i=0; i<100; i++){
            if(!set1.contains(i+1)){
                set2.add(i+1);
            }
        }
        
        for(int i: set2){
            if(Math.abs(i-X)<sa){
                sa = Math.abs(i-X);
                num = i;
            }
        }
        
        if(X<=50){
            if(X<=Math.abs(num-X)){
                System.out.println(0);
            }else{
                System.out.println(num);
            }
        }else{
            if(101-X<Math.abs(num-X)){
                System.out.println(101);
            }else{
                System.out.println(num);
            }
        }
        
    } main {
        
        Scanner scanner = new Scanner(System.in);
        int X = scanner.nextInt();
        int N = scanner.nextInt();
        HashSet<Integer> set1 = new HashSet<Integer>();
        HashSet<Integer> set2 = new HashSet<Integer>();
        int sa = 1000;
        int num = 0;
        
        for(int i=0; i<N; i++){
            int n = scanner.nextInt();
            set1.add(n);
        }
        
        for(int i=0; i<100; i++){
            if(!set1.contains(i+1)){
                set2.add(i+1);
            }
        }
        
        for(int i: set2){
            if(Math.abs(i-X)<sa){
                sa = Math.abs(i-X);
                num = i;
            }
        }
        
        if(X<=50){
            if(X<=Math.abs(num-X)){
                System.out.println(0);
            }else{
                System.out.println(num);
            }
        }else{
            if(101-X<Math.abs(num-X)){
                System.out.println(101);
            }else{
                System.out.println(num);
            }
        }
        
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int X = scanner.nextInt(); X scanner.nextInt() scanner.nextInt scanner int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner HashSet<Integer> set1 = new HashSet<Integer>(); set1 new HashSet<Integer>() HashSet<Integer> set2 = new HashSet<Integer>(); set2 new HashSet<Integer>() int sa = 1000; sa 1000 int num = 0; num 0 for(int i=0; i<N; i++){
            int n = scanner.nextInt();
            set1.add(n);
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            int n = scanner.nextInt();
            set1.add(n);
        } {
            int n = scanner.nextInt();
            set1.add(n);
        } int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner set1.add(n) set1.add set1 n for(int i=0; i<100; i++){
            if(!set1.contains(i+1)){
                set2.add(i+1);
            }
        } int i=0; int i=0; i 0 i<100 i 100 i++ i++ i {
            if(!set1.contains(i+1)){
                set2.add(i+1);
            }
        } {
            if(!set1.contains(i+1)){
                set2.add(i+1);
            }
        } if(!set1.contains(i+1)){
                set2.add(i+1);
            } !set1.contains(i+1) set1.contains(i+1) set1.contains set1 i+1 i 1 {
                set2.add(i+1);
            } set2.add(i+1) set2.add set2 i+1 i 1 for(int i: set2){
            if(Math.abs(i-X)<sa){
                sa = Math.abs(i-X);
                num = i;
            }
        } int i set2 {
            if(Math.abs(i-X)<sa){
                sa = Math.abs(i-X);
                num = i;
            }
        } {
            if(Math.abs(i-X)<sa){
                sa = Math.abs(i-X);
                num = i;
            }
        } if(Math.abs(i-X)<sa){
                sa = Math.abs(i-X);
                num = i;
            } Math.abs(i-X)<sa Math.abs(i-X) Math.abs Math i-X i X sa {
                sa = Math.abs(i-X);
                num = i;
            } sa = Math.abs(i-X) sa Math.abs(i-X) Math.abs Math i-X i X num = i num i if(X<=50){
            if(X<=Math.abs(num-X)){
                System.out.println(0);
            }else{
                System.out.println(num);
            }
        }else{
            if(101-X<Math.abs(num-X)){
                System.out.println(101);
            }else{
                System.out.println(num);
            }
        } X<=50 X 50 {
            if(X<=Math.abs(num-X)){
                System.out.println(0);
            }else{
                System.out.println(num);
            }
        } if(X<=Math.abs(num-X)){
                System.out.println(0);
            }else{
                System.out.println(num);
            } X<=Math.abs(num-X) X Math.abs(num-X) Math.abs Math num-X num X {
                System.out.println(0);
            } System.out.println(0) System.out.println System.out System System.out 0 {
                System.out.println(num);
            } System.out.println(num) System.out.println System.out System System.out num {
            if(101-X<Math.abs(num-X)){
                System.out.println(101);
            }else{
                System.out.println(num);
            }
        } if(101-X<Math.abs(num-X)){
                System.out.println(101);
            }else{
                System.out.println(num);
            } 101-X<Math.abs(num-X) 101-X 101 X Math.abs(num-X) Math.abs Math num-X num X {
                System.out.println(101);
            } System.out.println(101) System.out.println System.out System System.out 101 {
                System.out.println(num);
            } System.out.println(num) System.out.println System.out System System.out num String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        int X = scanner.nextInt();
        int N = scanner.nextInt();
        HashSet<Integer> set1 = new HashSet<Integer>();
        HashSet<Integer> set2 = new HashSet<Integer>();
        int sa = 1000;
        int num = 0;
        
        for(int i=0; i<N; i++){
            int n = scanner.nextInt();
            set1.add(n);
        }
        
        for(int i=0; i<100; i++){
            if(!set1.contains(i+1)){
                set2.add(i+1);
            }
        }
        
        for(int i: set2){
            if(Math.abs(i-X)<sa){
                sa = Math.abs(i-X);
                num = i;
            }
        }
        
        if(X<=50){
            if(X<=Math.abs(num-X)){
                System.out.println(0);
            }else{
                System.out.println(num);
            }
        }else{
            if(101-X<Math.abs(num-X)){
                System.out.println(101);
            }else{
                System.out.println(num);
            }
        }
        
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        int X = scanner.nextInt();
        int N = scanner.nextInt();
        HashSet<Integer> set1 = new HashSet<Integer>();
        HashSet<Integer> set2 = new HashSet<Integer>();
        int sa = 1000;
        int num = 0;
        
        for(int i=0; i<N; i++){
            int n = scanner.nextInt();
            set1.add(n);
        }
        
        for(int i=0; i<100; i++){
            if(!set1.contains(i+1)){
                set2.add(i+1);
            }
        }
        
        for(int i: set2){
            if(Math.abs(i-X)<sa){
                sa = Math.abs(i-X);
                num = i;
            }
        }
        
        if(X<=50){
            if(X<=Math.abs(num-X)){
                System.out.println(0);
            }else{
                System.out.println(num);
            }
        }else{
            if(101-X<Math.abs(num-X)){
                System.out.println(101);
            }else{
                System.out.println(num);
            }
        }
        
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        int X = scanner.nextInt();
        int N = scanner.nextInt();
        HashSet<Integer> set1 = new HashSet<Integer>();
        HashSet<Integer> set2 = new HashSet<Integer>();
        int sa = 1000;
        int num = 0;
        
        for(int i=0; i<N; i++){
            int n = scanner.nextInt();
            set1.add(n);
        }
        
        for(int i=0; i<100; i++){
            if(!set1.contains(i+1)){
                set2.add(i+1);
            }
        }
        
        for(int i: set2){
            if(Math.abs(i-X)<sa){
                sa = Math.abs(i-X);
                num = i;
            }
        }
        
        if(X<=50){
            if(X<=Math.abs(num-X)){
                System.out.println(0);
            }else{
                System.out.println(num);
            }
        }else{
            if(101-X<Math.abs(num-X)){
                System.out.println(101);
            }else{
                System.out.println(num);
            }
        }
        
    }
}
