import java.util.Arrays;
import java.util.Scanner;
import java.lang.*;
import java.io.*;

public class Main
{
	public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);

		// PrintStream obj = new PrintStream(new File("Output.txt"));
		// PrintStream console = System.out;
		// System.setOut(obj);

		int X = sc.nextInt();
		int N = sc.nextInt();

		int min = 0;
		int max = 101;

		int[] arr =  new int[N];

		for(int i = 0;i<N;i++)
		{
			arr[i] = sc.nextInt();
		}

		for(int i = 0;i<=100;i++)
		{
			int num1 = X - i;
			int num2 = X + i;

			int count1 = 0;
			int count2 = 0;

			for(int j = 0;j<N;j++)
			{
				if(arr[j] == num1)
					count1++;

				if(arr[j] == num2)
					count2++;
			}

			if(count1 == 0)
			{
				System.out.println(num1);
				break;
			}

			else if(count2 == 0)
			{
				System.out.println(num2);
				break;
			}
		}

		System.out.flush();
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util import java.lang.*; lang.* java import java.io.*; io.* java public class Main
{
	public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);

		// PrintStream obj = new PrintStream(new File("Output.txt"));
		// PrintStream console = System.out;
		// System.setOut(obj);

		int X = sc.nextInt();
		int N = sc.nextInt();

		int min = 0;
		int max = 101;

		int[] arr =  new int[N];

		for(int i = 0;i<N;i++)
		{
			arr[i] = sc.nextInt();
		}

		for(int i = 0;i<=100;i++)
		{
			int num1 = X - i;
			int num2 = X + i;

			int count1 = 0;
			int count2 = 0;

			for(int j = 0;j<N;j++)
			{
				if(arr[j] == num1)
					count1++;

				if(arr[j] == num2)
					count2++;
			}

			if(count1 == 0)
			{
				System.out.println(num1);
				break;
			}

			else if(count2 == 0)
			{
				System.out.println(num2);
				break;
			}
		}

		System.out.flush();
	}
} Main public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);

		// PrintStream obj = new PrintStream(new File("Output.txt"));
		// PrintStream console = System.out;
		// System.setOut(obj);

		int X = sc.nextInt();
		int N = sc.nextInt();

		int min = 0;
		int max = 101;

		int[] arr =  new int[N];

		for(int i = 0;i<N;i++)
		{
			arr[i] = sc.nextInt();
		}

		for(int i = 0;i<=100;i++)
		{
			int num1 = X - i;
			int num2 = X + i;

			int count1 = 0;
			int count2 = 0;

			for(int j = 0;j<N;j++)
			{
				if(arr[j] == num1)
					count1++;

				if(arr[j] == num2)
					count2++;
			}

			if(count1 == 0)
			{
				System.out.println(num1);
				break;
			}

			else if(count2 == 0)
			{
				System.out.println(num2);
				break;
			}
		}

		System.out.flush();
	} main {
		Scanner sc = new Scanner(System.in);

		// PrintStream obj = new PrintStream(new File("Output.txt"));
		// PrintStream console = System.out;
		// System.setOut(obj);

		int X = sc.nextInt();
		int N = sc.nextInt();

		int min = 0;
		int max = 101;

		int[] arr =  new int[N];

		for(int i = 0;i<N;i++)
		{
			arr[i] = sc.nextInt();
		}

		for(int i = 0;i<=100;i++)
		{
			int num1 = X - i;
			int num2 = X + i;

			int count1 = 0;
			int count2 = 0;

			for(int j = 0;j<N;j++)
			{
				if(arr[j] == num1)
					count1++;

				if(arr[j] == num2)
					count2++;
			}

			if(count1 == 0)
			{
				System.out.println(num1);
				break;
			}

			else if(count2 == 0)
			{
				System.out.println(num2);
				break;
			}
		}

		System.out.flush();
	} 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 int min = 0; min 0 int max = 101; max 101 int[] arr =  new int[N]; arr new int[N] N for(int i = 0;i<N;i++)
		{
			arr[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i<N i N i++ i++ i {
			arr[i] = sc.nextInt();
		} {
			arr[i] = sc.nextInt();
		} arr[i] = sc.nextInt() arr[i] arr i sc.nextInt() sc.nextInt sc for(int i = 0;i<=100;i++)
		{
			int num1 = X - i;
			int num2 = X + i;

			int count1 = 0;
			int count2 = 0;

			for(int j = 0;j<N;j++)
			{
				if(arr[j] == num1)
					count1++;

				if(arr[j] == num2)
					count2++;
			}

			if(count1 == 0)
			{
				System.out.println(num1);
				break;
			}

			else if(count2 == 0)
			{
				System.out.println(num2);
				break;
			}
		} int i = 0; int i = 0; i 0 i<=100 i 100 i++ i++ i {
			int num1 = X - i;
			int num2 = X + i;

			int count1 = 0;
			int count2 = 0;

			for(int j = 0;j<N;j++)
			{
				if(arr[j] == num1)
					count1++;

				if(arr[j] == num2)
					count2++;
			}

			if(count1 == 0)
			{
				System.out.println(num1);
				break;
			}

			else if(count2 == 0)
			{
				System.out.println(num2);
				break;
			}
		} {
			int num1 = X - i;
			int num2 = X + i;

			int count1 = 0;
			int count2 = 0;

			for(int j = 0;j<N;j++)
			{
				if(arr[j] == num1)
					count1++;

				if(arr[j] == num2)
					count2++;
			}

			if(count1 == 0)
			{
				System.out.println(num1);
				break;
			}

			else if(count2 == 0)
			{
				System.out.println(num2);
				break;
			}
		} int num1 = X - i; num1 X - i X i int num2 = X + i; num2 X + i X i int count1 = 0; count1 0 int count2 = 0; count2 0 for(int j = 0;j<N;j++)
			{
				if(arr[j] == num1)
					count1++;

				if(arr[j] == num2)
					count2++;
			} int j = 0; int j = 0; j 0 j<N j N j++ j++ j {
				if(arr[j] == num1)
					count1++;

				if(arr[j] == num2)
					count2++;
			} {
				if(arr[j] == num1)
					count1++;

				if(arr[j] == num2)
					count2++;
			} if(arr[j] == num1)
					count1++; arr[j] == num1 arr[j] arr j num1 count1++ count1 if(arr[j] == num2)
					count2++; arr[j] == num2 arr[j] arr j num2 count2++ count2 if(count1 == 0)
			{
				System.out.println(num1);
				break;
			}

			else if(count2 == 0)
			{
				System.out.println(num2);
				break;
			} count1 == 0 count1 0 {
				System.out.println(num1);
				break;
			} System.out.println(num1) System.out.println System.out System System.out num1 break; if(count2 == 0)
			{
				System.out.println(num2);
				break;
			} count2 == 0 count2 0 {
				System.out.println(num2);
				break;
			} System.out.println(num2) System.out.println System.out System System.out num2 break; System.out.flush() System.out.flush System.out System System.out String args[] args public class Main
{
	public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);

		// PrintStream obj = new PrintStream(new File("Output.txt"));
		// PrintStream console = System.out;
		// System.setOut(obj);

		int X = sc.nextInt();
		int N = sc.nextInt();

		int min = 0;
		int max = 101;

		int[] arr =  new int[N];

		for(int i = 0;i<N;i++)
		{
			arr[i] = sc.nextInt();
		}

		for(int i = 0;i<=100;i++)
		{
			int num1 = X - i;
			int num2 = X + i;

			int count1 = 0;
			int count2 = 0;

			for(int j = 0;j<N;j++)
			{
				if(arr[j] == num1)
					count1++;

				if(arr[j] == num2)
					count2++;
			}

			if(count1 == 0)
			{
				System.out.println(num1);
				break;
			}

			else if(count2 == 0)
			{
				System.out.println(num2);
				break;
			}
		}

		System.out.flush();
	}
} public class Main
{
	public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);

		// PrintStream obj = new PrintStream(new File("Output.txt"));
		// PrintStream console = System.out;
		// System.setOut(obj);

		int X = sc.nextInt();
		int N = sc.nextInt();

		int min = 0;
		int max = 101;

		int[] arr =  new int[N];

		for(int i = 0;i<N;i++)
		{
			arr[i] = sc.nextInt();
		}

		for(int i = 0;i<=100;i++)
		{
			int num1 = X - i;
			int num2 = X + i;

			int count1 = 0;
			int count2 = 0;

			for(int j = 0;j<N;j++)
			{
				if(arr[j] == num1)
					count1++;

				if(arr[j] == num2)
					count2++;
			}

			if(count1 == 0)
			{
				System.out.println(num1);
				break;
			}

			else if(count2 == 0)
			{
				System.out.println(num2);
				break;
			}
		}

		System.out.flush();
	}
} Main
import java.util.Arrays;
import java.util.Scanner;
import java.lang.*;
import java.io.*;

public class Main
{
	public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);

		// PrintStream obj = new PrintStream(new File("Output.txt"));
		// PrintStream console = System.out;
		// System.setOut(obj);

		int X = sc.nextInt();
		int N = sc.nextInt();

		int min = 0;
		int max = 101;

		int[] arr =  new int[N];

		for(int i = 0;i<N;i++)
		{
			arr[i] = sc.nextInt();
		}

		for(int i = 0;i<=100;i++)
		{
			int num1 = X - i;
			int num2 = X + i;

			int count1 = 0;
			int count2 = 0;

			for(int j = 0;j<N;j++)
			{
				if(arr[j] == num1)
					count1++;

				if(arr[j] == num2)
					count2++;
			}

			if(count1 == 0)
			{
				System.out.println(num1);
				break;
			}

			else if(count2 == 0)
			{
				System.out.println(num2);
				break;
			}
		}

		System.out.flush();
	}
}