import java.util.*;
import java.math.BigDecimal;

public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int a = sc.nextInt();//最もこれに近い整数を求める
		int b = sc.nextInt();//整数の数

		List<Integer> list = new ArrayList<>();
		
		for (int i = 0; i < b; i++) {
			list.add(sc.nextInt());
		}
		
		int index = 0;
		boolean flag = true;
		
		while (flag && -100 <= index && index <= 100) {
			a -= index;
			if (list.indexOf(a) == -1) {
				System.out.println(a);
				flag = false;
			} else {
				if (index >= 0) {
					index++;
				} else {
					index--;
				}
				if (index != 1) {
					index *= -1;
				}
				
			}
		}
	}
} import java.util.*; util.* java import java.math.BigDecimal; BigDecimal java.math public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int a = sc.nextInt();//最もこれに近い整数を求める
		int b = sc.nextInt();//整数の数

		List<Integer> list = new ArrayList<>();
		
		for (int i = 0; i < b; i++) {
			list.add(sc.nextInt());
		}
		
		int index = 0;
		boolean flag = true;
		
		while (flag && -100 <= index && index <= 100) {
			a -= index;
			if (list.indexOf(a) == -1) {
				System.out.println(a);
				flag = false;
			} else {
				if (index >= 0) {
					index++;
				} else {
					index--;
				}
				if (index != 1) {
					index *= -1;
				}
				
			}
		}
	}
} Main public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int a = sc.nextInt();//最もこれに近い整数を求める
		int b = sc.nextInt();//整数の数

		List<Integer> list = new ArrayList<>();
		
		for (int i = 0; i < b; i++) {
			list.add(sc.nextInt());
		}
		
		int index = 0;
		boolean flag = true;
		
		while (flag && -100 <= index && index <= 100) {
			a -= index;
			if (list.indexOf(a) == -1) {
				System.out.println(a);
				flag = false;
			} else {
				if (index >= 0) {
					index++;
				} else {
					index--;
				}
				if (index != 1) {
					index *= -1;
				}
				
			}
		}
	} main {
		
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int a = sc.nextInt();//最もこれに近い整数を求める
		int b = sc.nextInt();//整数の数

		List<Integer> list = new ArrayList<>();
		
		for (int i = 0; i < b; i++) {
			list.add(sc.nextInt());
		}
		
		int index = 0;
		boolean flag = true;
		
		while (flag && -100 <= index && index <= 100) {
			a -= index;
			if (list.indexOf(a) == -1) {
				System.out.println(a);
				flag = false;
			} else {
				if (index >= 0) {
					index++;
				} else {
					index--;
				}
				if (index != 1) {
					index *= -1;
				}
				
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc List<Integer> list = new ArrayList<>(); list new ArrayList<>() for (int i = 0; i < b; i++) {
			list.add(sc.nextInt());
		} int i = 0; int i = 0; i 0 i < b i b i++ i++ i {
			list.add(sc.nextInt());
		} {
			list.add(sc.nextInt());
		} list.add(sc.nextInt()) list.add list sc.nextInt() sc.nextInt sc int index = 0; index 0 boolean flag = true; flag true while (flag && -100 <= index && index <= 100) {
			a -= index;
			if (list.indexOf(a) == -1) {
				System.out.println(a);
				flag = false;
			} else {
				if (index >= 0) {
					index++;
				} else {
					index--;
				}
				if (index != 1) {
					index *= -1;
				}
				
			}
		} flag && -100 <= index && index <= 100 flag && -100 <= index && index <= 100 flag -100 <= index -100 100 index index <= 100 index 100 {
			a -= index;
			if (list.indexOf(a) == -1) {
				System.out.println(a);
				flag = false;
			} else {
				if (index >= 0) {
					index++;
				} else {
					index--;
				}
				if (index != 1) {
					index *= -1;
				}
				
			}
		} a -= index a index if (list.indexOf(a) == -1) {
				System.out.println(a);
				flag = false;
			} else {
				if (index >= 0) {
					index++;
				} else {
					index--;
				}
				if (index != 1) {
					index *= -1;
				}
				
			} list.indexOf(a) == -1 list.indexOf(a) list.indexOf list a -1 1 {
				System.out.println(a);
				flag = false;
			} System.out.println(a) System.out.println System.out System System.out a flag = false flag false {
				if (index >= 0) {
					index++;
				} else {
					index--;
				}
				if (index != 1) {
					index *= -1;
				}
				
			} if (index >= 0) {
					index++;
				} else {
					index--;
				} index >= 0 index 0 {
					index++;
				} index++ index {
					index--;
				} index-- index if (index != 1) {
					index *= -1;
				} index != 1 index 1 {
					index *= -1;
				} index *= -1 index -1 1 String[] args args public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int a = sc.nextInt();//最もこれに近い整数を求める
		int b = sc.nextInt();//整数の数

		List<Integer> list = new ArrayList<>();
		
		for (int i = 0; i < b; i++) {
			list.add(sc.nextInt());
		}
		
		int index = 0;
		boolean flag = true;
		
		while (flag && -100 <= index && index <= 100) {
			a -= index;
			if (list.indexOf(a) == -1) {
				System.out.println(a);
				flag = false;
			} else {
				if (index >= 0) {
					index++;
				} else {
					index--;
				}
				if (index != 1) {
					index *= -1;
				}
				
			}
		}
	}
} public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int a = sc.nextInt();//最もこれに近い整数を求める
		int b = sc.nextInt();//整数の数

		List<Integer> list = new ArrayList<>();
		
		for (int i = 0; i < b; i++) {
			list.add(sc.nextInt());
		}
		
		int index = 0;
		boolean flag = true;
		
		while (flag && -100 <= index && index <= 100) {
			a -= index;
			if (list.indexOf(a) == -1) {
				System.out.println(a);
				flag = false;
			} else {
				if (index >= 0) {
					index++;
				} else {
					index--;
				}
				if (index != 1) {
					index *= -1;
				}
				
			}
		}
	}
} Main
import java.util.*;
import java.math.BigDecimal;

public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int a = sc.nextInt();//最もこれに近い整数を求める
		int b = sc.nextInt();//整数の数

		List<Integer> list = new ArrayList<>();
		
		for (int i = 0; i < b; i++) {
			list.add(sc.nextInt());
		}
		
		int index = 0;
		boolean flag = true;
		
		while (flag && -100 <= index && index <= 100) {
			a -= index;
			if (list.indexOf(a) == -1) {
				System.out.println(a);
				flag = false;
			} else {
				if (index >= 0) {
					index++;
				} else {
					index--;
				}
				if (index != 1) {
					index *= -1;
				}
				
			}
		}
	}
}