#include #include using namespace std; int main() { int n, m; cin>>n>>m; vector a(n); for(int i=1;i<=n;++i) a[i-1]=i; while (m--) { int t; cin>>t; rotate(begin(a), begin(a)+t-1, begin(a)+t); } cout<