#include <stdio.h>
#include <stdlib.h>

#define MAX 200

void input(int *,int n);
int work(int *, int ,int );

int main()
{
	int number[MAX];
	int x, n;

	scanf("%d %d", &x, &n);
	input(number, n);

	printf("%d\n", work(number, x, n));

	return 0;
}

void input(int* number,int n)
{
	int a;

	for (int i = 0; i < MAX; i++) {
		number[i] = i + 1;
	}

	for (int i = 0; i < n; i++) {
		scanf("%d", &a);
		number[a - 1] = 0;
	}

}

int work(int* number, int x,int n)
{
	int r=x;
	int min = MAX;

	for (int i = 0; i < 100; i++) {
		if (min > abs(number[i] - x)) {
			min = abs(number[i] - x);
			r = i + 1;
		}
	}

	return r;
}