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

int main() {
  int x,y,z;
  int p[100];
  int min;
  int i, j;
  int a,b;
  b = -1;
  scanf("%d %d", &x,&y);
  j = 0;
  min = x;
  for(i = 0; i< 100; i++) p[i] = i+1;
  for(i = 0; i < y; i++) {
    if(i == y-1) {
      scanf("%d", &z);
      p[z-1] = 0;
    } else {
      scanf("%d ", &z);
      p[z-1] = 0;
    }
  }
  for(i=x-1; i>=0; i--) {
    if(p[i] != 0) break;
  }
  a = p[i];
  for(i=x-1; i < x+abs(x-a); i++) {
    if(p[i] != 0) break;
  }
  if(i != x + abs(x-a) + 1) b = p[i];
  if(b == -1 || abs(x-a) == abs(x-b)) {
    printf("%d\n",a);
  } else if(abs(x-a) > abs(x-b)) {
    printf("%d\n",b);
  } else if(abs(x-a) < abs(x-b)) {
    printf("%d\n",a);
  }
  return 0;
}
