#include using namespace std; typedef long long ll; #define rep(i,n) for(int i=0;i>n>>m; int a[n]; rep(i,n)a[i]=i+1; int temp=0; int res=0; rep(i,m){ cin>>temp; temp--; if(temp==0) continue; res=a[temp]; for(int j=temp;j>0;j--){ a[j]=a[j-1]; } a[0]=res; } cout<