import java.util.Scanner; public class Main { public static void main(String[] args) { try { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int[] card = new int[N]; int M = scan.nextInt(); for(int i = 0; i < N; ++i){ card[i] = i+1; } while(M-- > 0){ int num = scan.nextInt()-1; int sw = card[num]; for(int i = num; i > 0; --i){ card[i] = card[i-1]; } card[0] = sw; } System.out.println(card[0]); scan.close(); } catch (Exception e) { e.printStackTrace(); } } }