import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    byte x = sc.nextByte();
    byte n = sc.nextByte();
    if(n > 0) {
      boolean[] num = new boolean[102];
      byte li = 101;
      byte ui = 0;
      for(byte i = 0; i < n; i++) {
        byte val = sc.nextByte();
        if(li > val) li = val;
        if(ui < val) ui = val;
        num[val] = true;
      }
      sc.close();
      if(li >= 1) li--;
      if(ui <= 100) ui++;
      byte cl = 0;
      byte cld = 101;
      for(byte i = li; i <= ui; i++) {
        if(!num[i]) {
          byte nd = (byte)Math.abs((int)(x - i));
          if(cld > nd) {
            cld = nd;
            cl = i;
          }
        }
      }
      System.out.println(cl); 
    } else {
      System.out.println(x);
    }
  }
} import java.util.Scanner; Scanner java.util class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    byte x = sc.nextByte();
    byte n = sc.nextByte();
    if(n > 0) {
      boolean[] num = new boolean[102];
      byte li = 101;
      byte ui = 0;
      for(byte i = 0; i < n; i++) {
        byte val = sc.nextByte();
        if(li > val) li = val;
        if(ui < val) ui = val;
        num[val] = true;
      }
      sc.close();
      if(li >= 1) li--;
      if(ui <= 100) ui++;
      byte cl = 0;
      byte cld = 101;
      for(byte i = li; i <= ui; i++) {
        if(!num[i]) {
          byte nd = (byte)Math.abs((int)(x - i));
          if(cld > nd) {
            cld = nd;
            cl = i;
          }
        }
      }
      System.out.println(cl); 
    } else {
      System.out.println(x);
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    byte x = sc.nextByte();
    byte n = sc.nextByte();
    if(n > 0) {
      boolean[] num = new boolean[102];
      byte li = 101;
      byte ui = 0;
      for(byte i = 0; i < n; i++) {
        byte val = sc.nextByte();
        if(li > val) li = val;
        if(ui < val) ui = val;
        num[val] = true;
      }
      sc.close();
      if(li >= 1) li--;
      if(ui <= 100) ui++;
      byte cl = 0;
      byte cld = 101;
      for(byte i = li; i <= ui; i++) {
        if(!num[i]) {
          byte nd = (byte)Math.abs((int)(x - i));
          if(cld > nd) {
            cld = nd;
            cl = i;
          }
        }
      }
      System.out.println(cl); 
    } else {
      System.out.println(x);
    }
  } main {
    Scanner sc = new Scanner(System.in);
    byte x = sc.nextByte();
    byte n = sc.nextByte();
    if(n > 0) {
      boolean[] num = new boolean[102];
      byte li = 101;
      byte ui = 0;
      for(byte i = 0; i < n; i++) {
        byte val = sc.nextByte();
        if(li > val) li = val;
        if(ui < val) ui = val;
        num[val] = true;
      }
      sc.close();
      if(li >= 1) li--;
      if(ui <= 100) ui++;
      byte cl = 0;
      byte cld = 101;
      for(byte i = li; i <= ui; i++) {
        if(!num[i]) {
          byte nd = (byte)Math.abs((int)(x - i));
          if(cld > nd) {
            cld = nd;
            cl = i;
          }
        }
      }
      System.out.println(cl); 
    } else {
      System.out.println(x);
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) byte x = sc.nextByte(); x sc.nextByte() sc.nextByte sc byte n = sc.nextByte(); n sc.nextByte() sc.nextByte sc if(n > 0) {
      boolean[] num = new boolean[102];
      byte li = 101;
      byte ui = 0;
      for(byte i = 0; i < n; i++) {
        byte val = sc.nextByte();
        if(li > val) li = val;
        if(ui < val) ui = val;
        num[val] = true;
      }
      sc.close();
      if(li >= 1) li--;
      if(ui <= 100) ui++;
      byte cl = 0;
      byte cld = 101;
      for(byte i = li; i <= ui; i++) {
        if(!num[i]) {
          byte nd = (byte)Math.abs((int)(x - i));
          if(cld > nd) {
            cld = nd;
            cl = i;
          }
        }
      }
      System.out.println(cl); 
    } else {
      System.out.println(x);
    } n > 0 n 0 {
      boolean[] num = new boolean[102];
      byte li = 101;
      byte ui = 0;
      for(byte i = 0; i < n; i++) {
        byte val = sc.nextByte();
        if(li > val) li = val;
        if(ui < val) ui = val;
        num[val] = true;
      }
      sc.close();
      if(li >= 1) li--;
      if(ui <= 100) ui++;
      byte cl = 0;
      byte cld = 101;
      for(byte i = li; i <= ui; i++) {
        if(!num[i]) {
          byte nd = (byte)Math.abs((int)(x - i));
          if(cld > nd) {
            cld = nd;
            cl = i;
          }
        }
      }
      System.out.println(cl); 
    } boolean[] num = new boolean[102]; num new boolean[102] 102 byte li = 101; li 101 byte ui = 0; ui 0 for(byte i = 0; i < n; i++) {
        byte val = sc.nextByte();
        if(li > val) li = val;
        if(ui < val) ui = val;
        num[val] = true;
      } byte i = 0; byte i = 0; i 0 i < n i n i++ i++ i {
        byte val = sc.nextByte();
        if(li > val) li = val;
        if(ui < val) ui = val;
        num[val] = true;
      } {
        byte val = sc.nextByte();
        if(li > val) li = val;
        if(ui < val) ui = val;
        num[val] = true;
      } byte val = sc.nextByte(); val sc.nextByte() sc.nextByte sc if(li > val) li = val; li > val li val li = val li val if(ui < val) ui = val; ui < val ui val ui = val ui val num[val] = true num[val] num val true sc.close() sc.close sc if(li >= 1) li--; li >= 1 li 1 li-- li if(ui <= 100) ui++; ui <= 100 ui 100 ui++ ui byte cl = 0; cl 0 byte cld = 101; cld 101 for(byte i = li; i <= ui; i++) {
        if(!num[i]) {
          byte nd = (byte)Math.abs((int)(x - i));
          if(cld > nd) {
            cld = nd;
            cl = i;
          }
        }
      } byte i = li; byte i = li; i li i <= ui i ui i++ i++ i {
        if(!num[i]) {
          byte nd = (byte)Math.abs((int)(x - i));
          if(cld > nd) {
            cld = nd;
            cl = i;
          }
        }
      } {
        if(!num[i]) {
          byte nd = (byte)Math.abs((int)(x - i));
          if(cld > nd) {
            cld = nd;
            cl = i;
          }
        }
      } if(!num[i]) {
          byte nd = (byte)Math.abs((int)(x - i));
          if(cld > nd) {
            cld = nd;
            cl = i;
          }
        } !num[i] num[i] num i {
          byte nd = (byte)Math.abs((int)(x - i));
          if(cld > nd) {
            cld = nd;
            cl = i;
          }
        } byte nd = (byte)Math.abs((int)(x - i)); nd (byte)Math.abs((int)(x - i)) Math.abs Math (int)(x - i) x i if(cld > nd) {
            cld = nd;
            cl = i;
          } cld > nd cld nd {
            cld = nd;
            cl = i;
          } cld = nd cld nd cl = i cl i System.out.println(cl) System.out.println System.out System System.out cl {
      System.out.println(x);
    } System.out.println(x) System.out.println System.out System System.out x String[] args args
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    byte x = sc.nextByte();
    byte n = sc.nextByte();
    if(n > 0) {
      boolean[] num = new boolean[102];
      byte li = 101;
      byte ui = 0;
      for(byte i = 0; i < n; i++) {
        byte val = sc.nextByte();
        if(li > val) li = val;
        if(ui < val) ui = val;
        num[val] = true;
      }
      sc.close();
      if(li >= 1) li--;
      if(ui <= 100) ui++;
      byte cl = 0;
      byte cld = 101;
      for(byte i = li; i <= ui; i++) {
        if(!num[i]) {
          byte nd = (byte)Math.abs((int)(x - i));
          if(cld > nd) {
            cld = nd;
            cl = i;
          }
        }
      }
      System.out.println(cl); 
    } else {
      System.out.println(x);
    }
  }
}