import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		
		int x = scan.nextInt();
		int n = scan.nextInt();
		
		ArrayList<Integer> list = new ArrayList<Integer>();
		
		for(int i = 0; i < n; i++) {
			list.add(scan.nextInt());
		}
		
		for(int i = 0; i < 102; i++) {
			if(list.contains(x-i) != true) {
				System.out.print(x-i);
				return;
			}
			else if(list.contains(x+i) != true) {
				System.out.print(x+i);
				return;
			}
		}
		
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		
		int x = scan.nextInt();
		int n = scan.nextInt();
		
		ArrayList<Integer> list = new ArrayList<Integer>();
		
		for(int i = 0; i < n; i++) {
			list.add(scan.nextInt());
		}
		
		for(int i = 0; i < 102; i++) {
			if(list.contains(x-i) != true) {
				System.out.print(x-i);
				return;
			}
			else if(list.contains(x+i) != true) {
				System.out.print(x+i);
				return;
			}
		}
		
	}
} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		
		int x = scan.nextInt();
		int n = scan.nextInt();
		
		ArrayList<Integer> list = new ArrayList<Integer>();
		
		for(int i = 0; i < n; i++) {
			list.add(scan.nextInt());
		}
		
		for(int i = 0; i < 102; i++) {
			if(list.contains(x-i) != true) {
				System.out.print(x-i);
				return;
			}
			else if(list.contains(x+i) != true) {
				System.out.print(x+i);
				return;
			}
		}
		
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		
		int x = scan.nextInt();
		int n = scan.nextInt();
		
		ArrayList<Integer> list = new ArrayList<Integer>();
		
		for(int i = 0; i < n; i++) {
			list.add(scan.nextInt());
		}
		
		for(int i = 0; i < 102; i++) {
			if(list.contains(x-i) != true) {
				System.out.print(x-i);
				return;
			}
			else if(list.contains(x+i) != true) {
				System.out.print(x+i);
				return;
			}
		}
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int x = scan.nextInt(); x scan.nextInt() scan.nextInt scan int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan ArrayList<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() for(int i = 0; i < n; i++) {
			list.add(scan.nextInt());
		} int i = 0; int i = 0; i 0 i < n i n 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 < 102; i++) {
			if(list.contains(x-i) != true) {
				System.out.print(x-i);
				return;
			}
			else if(list.contains(x+i) != true) {
				System.out.print(x+i);
				return;
			}
		} int i = 0; int i = 0; i 0 i < 102 i 102 i++ i++ i {
			if(list.contains(x-i) != true) {
				System.out.print(x-i);
				return;
			}
			else if(list.contains(x+i) != true) {
				System.out.print(x+i);
				return;
			}
		} {
			if(list.contains(x-i) != true) {
				System.out.print(x-i);
				return;
			}
			else if(list.contains(x+i) != true) {
				System.out.print(x+i);
				return;
			}
		} if(list.contains(x-i) != true) {
				System.out.print(x-i);
				return;
			}
			else if(list.contains(x+i) != true) {
				System.out.print(x+i);
				return;
			} list.contains(x-i) != true list.contains(x-i) list.contains list x-i x i true {
				System.out.print(x-i);
				return;
			} System.out.print(x-i) System.out.print System.out System System.out x-i x i return; if(list.contains(x+i) != true) {
				System.out.print(x+i);
				return;
			} list.contains(x+i) != true list.contains(x+i) list.contains list x+i x i true {
				System.out.print(x+i);
				return;
			} System.out.print(x+i) System.out.print System.out System System.out x+i x i return; String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		
		int x = scan.nextInt();
		int n = scan.nextInt();
		
		ArrayList<Integer> list = new ArrayList<Integer>();
		
		for(int i = 0; i < n; i++) {
			list.add(scan.nextInt());
		}
		
		for(int i = 0; i < 102; i++) {
			if(list.contains(x-i) != true) {
				System.out.print(x-i);
				return;
			}
			else if(list.contains(x+i) != true) {
				System.out.print(x+i);
				return;
			}
		}
		
	}
} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		
		int x = scan.nextInt();
		int n = scan.nextInt();
		
		ArrayList<Integer> list = new ArrayList<Integer>();
		
		for(int i = 0; i < n; i++) {
			list.add(scan.nextInt());
		}
		
		for(int i = 0; i < 102; i++) {
			if(list.contains(x-i) != true) {
				System.out.print(x-i);
				return;
			}
			else if(list.contains(x+i) != true) {
				System.out.print(x+i);
				return;
			}
		}
		
	}
} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		
		int x = scan.nextInt();
		int n = scan.nextInt();
		
		ArrayList<Integer> list = new ArrayList<Integer>();
		
		for(int i = 0; i < n; i++) {
			list.add(scan.nextInt());
		}
		
		for(int i = 0; i < 102; i++) {
			if(list.contains(x-i) != true) {
				System.out.print(x-i);
				return;
			}
			else if(list.contains(x+i) != true) {
				System.out.print(x+i);
				return;
			}
		}
		
	}
}