import java.util.*;

public class Main{
  public static void main(String[] args){

    Scanner scan = new Scanner(System.in);
    int x = scan.nextInt();
    int n = scan.nextInt();
    if (n == 0){
      System.out.println(x);
      return;
    }
    int [] a = new int[103];

    for (int i=0;i<103;i++){
      a[i] = i-1;
    }

    for (int j=0;j<n;j++){
      int t = scan.nextInt();
      a[t+1] = -2;
    }

    if (a[x+1] != -2){
      System.out.println(x);
      return;
    }

    int small = 104;
    int val = -3;
    for (int p=0;p<103;p++){
      if (a[p] == -2){
        continue;
      }
      int abs = x-a[p];
      if (abs == 0){
        System.out.println(x);
        return;
      }

      if (abs < 0){
        abs = -abs;
      }
      if (abs < small){
        small = abs;
        val = a[p];
      }
    }

    System.out.println(val);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){

    Scanner scan = new Scanner(System.in);
    int x = scan.nextInt();
    int n = scan.nextInt();
    if (n == 0){
      System.out.println(x);
      return;
    }
    int [] a = new int[103];

    for (int i=0;i<103;i++){
      a[i] = i-1;
    }

    for (int j=0;j<n;j++){
      int t = scan.nextInt();
      a[t+1] = -2;
    }

    if (a[x+1] != -2){
      System.out.println(x);
      return;
    }

    int small = 104;
    int val = -3;
    for (int p=0;p<103;p++){
      if (a[p] == -2){
        continue;
      }
      int abs = x-a[p];
      if (abs == 0){
        System.out.println(x);
        return;
      }

      if (abs < 0){
        abs = -abs;
      }
      if (abs < small){
        small = abs;
        val = a[p];
      }
    }

    System.out.println(val);
  }
} Main public static void main(String[] args){

    Scanner scan = new Scanner(System.in);
    int x = scan.nextInt();
    int n = scan.nextInt();
    if (n == 0){
      System.out.println(x);
      return;
    }
    int [] a = new int[103];

    for (int i=0;i<103;i++){
      a[i] = i-1;
    }

    for (int j=0;j<n;j++){
      int t = scan.nextInt();
      a[t+1] = -2;
    }

    if (a[x+1] != -2){
      System.out.println(x);
      return;
    }

    int small = 104;
    int val = -3;
    for (int p=0;p<103;p++){
      if (a[p] == -2){
        continue;
      }
      int abs = x-a[p];
      if (abs == 0){
        System.out.println(x);
        return;
      }

      if (abs < 0){
        abs = -abs;
      }
      if (abs < small){
        small = abs;
        val = a[p];
      }
    }

    System.out.println(val);
  } main {

    Scanner scan = new Scanner(System.in);
    int x = scan.nextInt();
    int n = scan.nextInt();
    if (n == 0){
      System.out.println(x);
      return;
    }
    int [] a = new int[103];

    for (int i=0;i<103;i++){
      a[i] = i-1;
    }

    for (int j=0;j<n;j++){
      int t = scan.nextInt();
      a[t+1] = -2;
    }

    if (a[x+1] != -2){
      System.out.println(x);
      return;
    }

    int small = 104;
    int val = -3;
    for (int p=0;p<103;p++){
      if (a[p] == -2){
        continue;
      }
      int abs = x-a[p];
      if (abs == 0){
        System.out.println(x);
        return;
      }

      if (abs < 0){
        abs = -abs;
      }
      if (abs < small){
        small = abs;
        val = a[p];
      }
    }

    System.out.println(val);
  } 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 if (n == 0){
      System.out.println(x);
      return;
    } n == 0 n 0 {
      System.out.println(x);
      return;
    } System.out.println(x) System.out.println System.out System System.out x return; int [] a = new int[103]; a new int[103] 103 for (int i=0;i<103;i++){
      a[i] = i-1;
    } int i=0; int i=0; i 0 i<103 i 103 i++ i++ i {
      a[i] = i-1;
    } {
      a[i] = i-1;
    } a[i] = i-1 a[i] a i i-1 i 1 for (int j=0;j<n;j++){
      int t = scan.nextInt();
      a[t+1] = -2;
    } int j=0; int j=0; j 0 j<n j n j++ j++ j {
      int t = scan.nextInt();
      a[t+1] = -2;
    } {
      int t = scan.nextInt();
      a[t+1] = -2;
    } int t = scan.nextInt(); t scan.nextInt() scan.nextInt scan a[t+1] = -2 a[t+1] a t+1 t 1 -2 2 if (a[x+1] != -2){
      System.out.println(x);
      return;
    } a[x+1] != -2 a[x+1] a x+1 x 1 -2 2 {
      System.out.println(x);
      return;
    } System.out.println(x) System.out.println System.out System System.out x return; int small = 104; small 104 int val = -3; val -3 3 for (int p=0;p<103;p++){
      if (a[p] == -2){
        continue;
      }
      int abs = x-a[p];
      if (abs == 0){
        System.out.println(x);
        return;
      }

      if (abs < 0){
        abs = -abs;
      }
      if (abs < small){
        small = abs;
        val = a[p];
      }
    } int p=0; int p=0; p 0 p<103 p 103 p++ p++ p {
      if (a[p] == -2){
        continue;
      }
      int abs = x-a[p];
      if (abs == 0){
        System.out.println(x);
        return;
      }

      if (abs < 0){
        abs = -abs;
      }
      if (abs < small){
        small = abs;
        val = a[p];
      }
    } {
      if (a[p] == -2){
        continue;
      }
      int abs = x-a[p];
      if (abs == 0){
        System.out.println(x);
        return;
      }

      if (abs < 0){
        abs = -abs;
      }
      if (abs < small){
        small = abs;
        val = a[p];
      }
    } if (a[p] == -2){
        continue;
      } a[p] == -2 a[p] a p -2 2 {
        continue;
      } continue; int abs = x-a[p]; abs x-a[p] x a[p] a p if (abs == 0){
        System.out.println(x);
        return;
      } abs == 0 abs 0 {
        System.out.println(x);
        return;
      } System.out.println(x) System.out.println System.out System System.out x return; if (abs < 0){
        abs = -abs;
      } abs < 0 abs 0 {
        abs = -abs;
      } abs = -abs abs -abs abs if (abs < small){
        small = abs;
        val = a[p];
      } abs < small abs small {
        small = abs;
        val = a[p];
      } small = abs small abs val = a[p] val a[p] a p System.out.println(val) System.out.println System.out System System.out val String[] args args public class Main{
  public static void main(String[] args){

    Scanner scan = new Scanner(System.in);
    int x = scan.nextInt();
    int n = scan.nextInt();
    if (n == 0){
      System.out.println(x);
      return;
    }
    int [] a = new int[103];

    for (int i=0;i<103;i++){
      a[i] = i-1;
    }

    for (int j=0;j<n;j++){
      int t = scan.nextInt();
      a[t+1] = -2;
    }

    if (a[x+1] != -2){
      System.out.println(x);
      return;
    }

    int small = 104;
    int val = -3;
    for (int p=0;p<103;p++){
      if (a[p] == -2){
        continue;
      }
      int abs = x-a[p];
      if (abs == 0){
        System.out.println(x);
        return;
      }

      if (abs < 0){
        abs = -abs;
      }
      if (abs < small){
        small = abs;
        val = a[p];
      }
    }

    System.out.println(val);
  }
} public class Main{
  public static void main(String[] args){

    Scanner scan = new Scanner(System.in);
    int x = scan.nextInt();
    int n = scan.nextInt();
    if (n == 0){
      System.out.println(x);
      return;
    }
    int [] a = new int[103];

    for (int i=0;i<103;i++){
      a[i] = i-1;
    }

    for (int j=0;j<n;j++){
      int t = scan.nextInt();
      a[t+1] = -2;
    }

    if (a[x+1] != -2){
      System.out.println(x);
      return;
    }

    int small = 104;
    int val = -3;
    for (int p=0;p<103;p++){
      if (a[p] == -2){
        continue;
      }
      int abs = x-a[p];
      if (abs == 0){
        System.out.println(x);
        return;
      }

      if (abs < 0){
        abs = -abs;
      }
      if (abs < small){
        small = abs;
        val = a[p];
      }
    }

    System.out.println(val);
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){

    Scanner scan = new Scanner(System.in);
    int x = scan.nextInt();
    int n = scan.nextInt();
    if (n == 0){
      System.out.println(x);
      return;
    }
    int [] a = new int[103];

    for (int i=0;i<103;i++){
      a[i] = i-1;
    }

    for (int j=0;j<n;j++){
      int t = scan.nextInt();
      a[t+1] = -2;
    }

    if (a[x+1] != -2){
      System.out.println(x);
      return;
    }

    int small = 104;
    int val = -3;
    for (int p=0;p<103;p++){
      if (a[p] == -2){
        continue;
      }
      int abs = x-a[p];
      if (abs == 0){
        System.out.println(x);
        return;
      }

      if (abs < 0){
        abs = -abs;
      }
      if (abs < small){
        small = abs;
        val = a[p];
      }
    }

    System.out.println(val);
  }
}
