import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int seisu = scan.nextInt();
		int len = scan.nextInt();
		List<Integer> list = new ArrayList<Integer>();
		int min = Integer.MAX_VALUE;
		int ans = 0;

		for(int i=0;i<len;i++) {
			list.add(scan.nextInt());
		}

		for(int i=0;i<=110;i++) {
			if(!list.contains(i)) {
				if(min > Math.abs(i-seisu)) {
				min = Math.abs(i-seisu);
				ans = i;
				}
			}

		}
		System.out.println(ans);
		scan.close();

	}

} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int seisu = scan.nextInt();
		int len = scan.nextInt();
		List<Integer> list = new ArrayList<Integer>();
		int min = Integer.MAX_VALUE;
		int ans = 0;

		for(int i=0;i<len;i++) {
			list.add(scan.nextInt());
		}

		for(int i=0;i<=110;i++) {
			if(!list.contains(i)) {
				if(min > Math.abs(i-seisu)) {
				min = Math.abs(i-seisu);
				ans = i;
				}
			}

		}
		System.out.println(ans);
		scan.close();

	}

} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int seisu = scan.nextInt();
		int len = scan.nextInt();
		List<Integer> list = new ArrayList<Integer>();
		int min = Integer.MAX_VALUE;
		int ans = 0;

		for(int i=0;i<len;i++) {
			list.add(scan.nextInt());
		}

		for(int i=0;i<=110;i++) {
			if(!list.contains(i)) {
				if(min > Math.abs(i-seisu)) {
				min = Math.abs(i-seisu);
				ans = i;
				}
			}

		}
		System.out.println(ans);
		scan.close();

	} main {

		Scanner scan = new Scanner(System.in);

		int seisu = scan.nextInt();
		int len = scan.nextInt();
		List<Integer> list = new ArrayList<Integer>();
		int min = Integer.MAX_VALUE;
		int ans = 0;

		for(int i=0;i<len;i++) {
			list.add(scan.nextInt());
		}

		for(int i=0;i<=110;i++) {
			if(!list.contains(i)) {
				if(min > Math.abs(i-seisu)) {
				min = Math.abs(i-seisu);
				ans = i;
				}
			}

		}
		System.out.println(ans);
		scan.close();

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int seisu = scan.nextInt(); seisu scan.nextInt() scan.nextInt scan int len = scan.nextInt(); len scan.nextInt() scan.nextInt scan List<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE int ans = 0; ans 0 for(int i=0;i<len;i++) {
			list.add(scan.nextInt());
		} int i=0; int i=0; i 0 i<len i len i++ i++ i {
			list.add(scan.nextInt());
		} {
			list.add(scan.nextInt());
		} list.add(scan.nextInt()) list.add list scan.nextInt() scan.nextInt scan for(int i=0;i<=110;i++) {
			if(!list.contains(i)) {
				if(min > Math.abs(i-seisu)) {
				min = Math.abs(i-seisu);
				ans = i;
				}
			}

		} int i=0; int i=0; i 0 i<=110 i 110 i++ i++ i {
			if(!list.contains(i)) {
				if(min > Math.abs(i-seisu)) {
				min = Math.abs(i-seisu);
				ans = i;
				}
			}

		} {
			if(!list.contains(i)) {
				if(min > Math.abs(i-seisu)) {
				min = Math.abs(i-seisu);
				ans = i;
				}
			}

		} if(!list.contains(i)) {
				if(min > Math.abs(i-seisu)) {
				min = Math.abs(i-seisu);
				ans = i;
				}
			} !list.contains(i) list.contains(i) list.contains list i {
				if(min > Math.abs(i-seisu)) {
				min = Math.abs(i-seisu);
				ans = i;
				}
			} if(min > Math.abs(i-seisu)) {
				min = Math.abs(i-seisu);
				ans = i;
				} min > Math.abs(i-seisu) min Math.abs(i-seisu) Math.abs Math i-seisu i seisu {
				min = Math.abs(i-seisu);
				ans = i;
				} min = Math.abs(i-seisu) min Math.abs(i-seisu) Math.abs Math i-seisu i seisu ans = i ans i System.out.println(ans) System.out.println System.out System System.out ans scan.close() scan.close scan String[] args args public class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int seisu = scan.nextInt();
		int len = scan.nextInt();
		List<Integer> list = new ArrayList<Integer>();
		int min = Integer.MAX_VALUE;
		int ans = 0;

		for(int i=0;i<len;i++) {
			list.add(scan.nextInt());
		}

		for(int i=0;i<=110;i++) {
			if(!list.contains(i)) {
				if(min > Math.abs(i-seisu)) {
				min = Math.abs(i-seisu);
				ans = i;
				}
			}

		}
		System.out.println(ans);
		scan.close();

	}

} public class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int seisu = scan.nextInt();
		int len = scan.nextInt();
		List<Integer> list = new ArrayList<Integer>();
		int min = Integer.MAX_VALUE;
		int ans = 0;

		for(int i=0;i<len;i++) {
			list.add(scan.nextInt());
		}

		for(int i=0;i<=110;i++) {
			if(!list.contains(i)) {
				if(min > Math.abs(i-seisu)) {
				min = Math.abs(i-seisu);
				ans = i;
				}
			}

		}
		System.out.println(ans);
		scan.close();

	}

} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int seisu = scan.nextInt();
		int len = scan.nextInt();
		List<Integer> list = new ArrayList<Integer>();
		int min = Integer.MAX_VALUE;
		int ans = 0;

		for(int i=0;i<len;i++) {
			list.add(scan.nextInt());
		}

		for(int i=0;i<=110;i++) {
			if(!list.contains(i)) {
				if(min > Math.abs(i-seisu)) {
				min = Math.abs(i-seisu);
				ans = i;
				}
			}

		}
		System.out.println(ans);
		scan.close();

	}

}
