Problem: n children are standing in a circle and playing a game. Children's numbers in clockwise order form a permutation a1, a2, ..., an of length n. It is an integer sequence such that each integer from 1 to n appears exactly once in it.

The game consists of m steps. On each step the current leader with index i counts out ai people in clockwise order, starting from the next person. The last one to be pointed at by the leader becomes the new leader.

You are given numbers l1, l2, ..., lm — indices of leaders in the beginning of each step. Child with number l1 is the first leader in the game. 

Write a program which will restore a possible permutation a1, a2, ..., an. If there are multiple solutions then print any of them. If there is no solution then print -1.

Input

The first line contains two integer numbers n, m (1 ≤ n, m ≤ 100).

The second line contains m integer numbers l1, l2, ..., lm (1 ≤ li ≤ n) — indices of leaders in the beginning of each step.

Output

Print such permutation of n numbers a1, a2, ..., an that leaders in the game will be exactly l1, l2, ..., lm if all the rules are followed. If there are multiple solutions print any of them. 

If there is no permutation which satisfies all described conditions print -1.

Examples

Input

4 5
2 3 1 4 4


Output

3 1 2 4 


Input

3 3
3 1 2


Output

-1

Note

Let's follow leadership in the first example: 

  * Child 2 starts. 
  * Leadership goes from 2 to 2 + a2 = 3. 
  * Leadership goes from 3 to 3 + a3 = 5. As it's greater than 4, it's going in a circle to 1. 
  * Leadership goes from 1 to 1 + a1 = 4. 
  * Leadership goes from 4 to 4 + a4 = 8. Thus in circle it still remains at 4. 

Solution (in JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.util.Set;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author saadnoor
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        int[] inputArray = new int[1023];

        public boolean isValid(int ans[], int m, int n) {
            // if(true)return  true;
            for (int i = 0; i < m - 1; i++) {
                int next = (inputArray[i] + ans[inputArray[i]]) % n;
                if (next == 0) next = n;
                //System.out.println(i+"next ->"+next);
                if (next != inputArray[i + 1]) return false;
            }
            Set<Integer> S = new HashSet<>();
            for (int i = 0; i < n; i++) {
                S.add(ans[i + 1]);
            }
            if (S.size() != n) return false;
            return true;
        }

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n, m;
            n = in.nextInt();
            m = in.nextInt();

            int myArray[] = new int[1023];
            for (int i = 0; i < m; i++) {
                inputArray[i] = in.nextInt();
            }
            int ans[] = new int[10234];
            int needToadd = 0;
            for (int i = 0; i < m; i++) {
                if (i == 0) myArray[0] = inputArray[0];
                else {
                    if (!(inputArray[i - 1] < inputArray[i])) needToadd += n;
                    myArray[i] = inputArray[i] + needToadd;
                }
            }
            for (int i = 0; i < m; i++) {
                //  out.println(myArray[i]);
            }
            Arrays.fill(ans, -1);
            int visited[] = new int[12345];
            Arrays.fill(visited, 0);
            for (int i = 1; i < m; i++) {
                int node = myArray[i - 1] % n;
                if (node == 0) node = n;
                if (ans[node] != -1) {
                    // out.println(-1);
                    // break;
                }
                visited[myArray[i] - myArray[i - 1]] = 1;
                // out.println("arr fak: "+(myArray[i]-myArray[i-1]));
                ans[node] = myArray[i] - myArray[i - 1];
            }
            for (int i = 1; i <= n; i++) {
                // if(ans[i]!=-1)visited[i]=1;
                // out.println(ans[i]);
            }
            ArrayList<Integer> vec = new ArrayList<>();
            ArrayList<Integer> values = new ArrayList<>();
            for (int i = 1; i <= n; i++) {
                if (ans[i] == -1) vec.add(i);
            }
            for (int i = 1; i <= n; i++) {
                if (visited[i] == 0) {
                    values.add(i);
                }
            }
            if (values.size() != vec.size()) {
                out.println(-1);
            } else {
                for (int i = 1; i <= values.size(); i++) {
                    ans[vec.get(i - 1)] = values.get(i - 1);
                }
                if (isValid(ans, m, n)) {
                    for (int i = 0; i < n; i++) {
                        out.print(ans[i + 1] + " ");
                    }

                } else out.println(-1);
            }


        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void close() {
            writer.close();
        }

        public void println(int i) {
            writer.println(i);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}