import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Solution to Ghost Leg
 * 
 * @author vanb
 */
public class ghostleg_vanb
{
    /** Input. */
    private static Scanner sc;
    
    /** Output. */
    private static PrintStream ps;
    
    /**
     * Do it!
     */
    private void doit()
    {
        int n = sc.nextInt();
        int m = sc.nextInt();
        
        int perm[] = new int[n];
        for( int i=0; i<n; i++ ) perm[i] = i+1;
        for( int i=0; i<m; i++ )
        {
            int k = sc.nextInt();
            int temp = perm[k-1];
            perm[k-1] = perm[k];
            perm[k] = temp;
        }
        
        for( int x : perm ) ps.println( x );
    }
        
    /**
     * Main.
     * 
     * @param args unused
     * @throws Exception
     */
    public static void main( String[] args ) throws Exception
    {
        sc = new Scanner( System.in );
        ps = System.out;
        
        new ghostleg_vanb().doit();
    }

}
