#arc130e. [arc130_e]Increasing Minimum

[arc130_e]Increasing Minimum

Problem Statement

Consider doing the operation below on a sequence of NN positive integers A=(A1,A2,ldots,AN)A = (A_1, A_2, \\ldots, A_N) to obtain a sequence I=(i1,i2,ldots,iK)I = (i_1, i_2, \\ldots, i_K).

  • For each k=1,2,ldots,Kk = 1, 2, \\ldots, K in this order, do the following.
    • Choose an ii such that Ai=minA1,A2,ldots,ANA_i = \\min\\{A_1, A_2, \\ldots, A_N\\}.
    • Let ik=ii_k = i.
    • Add 11 to AiA_i.

You are given integers NN, KK, and a sequence II.

Determine whether there exists a sequence of positive integers AA for which it is possible to obtain II from the operation. If it exists, find the lexicographically smallest such sequence.

Constraints

  • 1leqN,Kleq3times1051\\leq N, K\\leq 3\\times 10^5
  • 1leqikleqN1\\leq i_k\\leq N

Input

Input is given from Standard Input in the following format:

NN KK i1i_1 i2i_2 ldots\\ldots iKi_K

Output

If there is no sequence of positive integers AA for which it is possible to obtain II from the operation, print -1. If it exists, print the lexicographically smallest among such sequences AA, in one line, with spaces in between.


Sample Input 1

4 6
1 1 4 4 2 1

Sample Output 1

1 3 3 2

Some of the sequences for which it is possible to obtain I=(1,1,4,4,2,1)I = (1,1,4,4,2,1) from the operation are (1,3,3,2)(1, 3, 3, 2) and (2,4,5,3)(2, 4, 5, 3). The lexicographically smallest among them is (1,3,3,2)(1, 3, 3, 2).


Sample Input 2

4 6
2 2 2 2 2 2

Sample Output 2

6 1 6 6

Sample Input 3

4 6
1 1 2 2 3 3

Sample Output 3

-1