#include<bits/stdc++.h>usingnamespacestd;voidsolve(){intn,q;cin>>n>>q;vector<longlong>a(n);// Key is Index. Value is the initial value that the element starts with.
map<int,longlong>inside;longlongdelta=0;for(intzz=0;zz<q;zz++){intx;cin>>x;x--;// Missing from the set. Add it with a delta offset.
if(inside.find(x)==inside.end()){inside[x]=a[x]-delta;}else{// Remove it from the set and remember the current value.
a[x]=inside[x]+delta;inside.erase(x);}delta+=(int)inside.size();}for(auto&[x,initial]:inside){a[x]=initial+delta;}for(inti=0;i<n;i++){cout<<a[i]<<" ";}cout<<endl;}intmain(){solve();return0;}