You are given an integer m, and a list of n distinct integers between 0 and m - 1.

You would like to construct a sequence satisfying the properties:

  * Each element is an integer between 0 and m - 1, inclusive. 
  * All prefix products of the sequence modulo m are distinct. 
  * No prefix product modulo m appears as an element of the input list. 
  * The length of the sequence is maximized. 



Construct any sequence satisfying the properties above.

Input

The first line of input contains two integers n and m (0 ≤ n < m ≤ 200 000) — the number of forbidden prefix products and the modulus.

If n is non-zero, the next line of input contains n distinct integers between 0 and m - 1, the forbidden prefix products. If n is zero, this line doesn't exist.

Output

On the first line, print the number k, denoting the length of your sequence.

On the second line, print k space separated integers, denoting your sequence.

Examples

Input

0 5


Output

5
1 2 4 3 0


Input

3 10
2 9 1


Output

6
3 9 2 9 8 0

Note

For the first case, the prefix products of this sequence modulo m are [1, 2, 3, 4, 0].

For the second case, the prefix products of this sequence modulo m are [3, 7, 4, 6, 8, 0].
import java.io.*;
import java.util.*;
import java.math.BigInteger;
import java.util.Map.Entry;

import static java.lang.Math.*;

public class C extends PrintWriter {

    long inv(long n, long m) {
        long mod = m, t, x = 1, y = 0;

        while (n > 1) {
            long q = n / m;
            long r = n % m;

            n = m;
            m = r;

            t = y;
            y = x - q * y;
            x = t;
        }
        if (x < 0) {
            x += mod;
        }
        return x;
    }

    long solve(long a, long b, long m) {
        long g = gcd(a, m);

        if (b % g == 0) {
            long x = inv(a / g, m / g);
            long d = b / g;

            return (d * x) % m;
        } else {
            return -1;
        }
    }

    long test(long a, long b, long m) {

        for (long x = 0; x < m; x++) {
            if ((a * x) % m == b) {
                return x;
            }
        }

        return -1;
    }

    long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    void run() {
        int n = nextInt();
        int m = nextInt();

        boolean[] use = new boolean[m];

        Arrays.fill(use, true);

        for (int i = 0; i < n; i++) {
            use[nextInt()] = false;
        }

        List<Long> ans = new ArrayList<>();

        List<Long>[] comp = new ArrayList[m];

        for (int i = 0; i < m; i++) {
            comp[i] = new ArrayList<Long>();
        }

        for (int i = 1; i < m; i++) {
            if (use[i]) {
                comp[(int) gcd(i, m)].add((long) i);
            }
        }

        int k = 0;

        int[] d = new int[m];

        for (int i = 1; i < m; i++) {
            if (comp[i].size() != 0) {
                d[k++] = i;
            }
        }

        if (k > 0) {
            int[] size = new int[k];
            int[] to = new int[k];

            Arrays.fill(to, -1);

            for (int i = 0; i < k; i++) {
                for (int j = 0; j < i; j++) {
                    if (d[i] % d[j] == 0) {
                        if (size[j] >= size[i]) {
                            size[i] = size[j];
                            to[i] = j;
                        }
                    }
                }
                size[i] += comp[d[i]].size();
            }

            int v = 0;

            for (int i = 1; i < k; i++) {
                if (size[i] > size[v]) {
                    v = i;
                }
            }

            while (v != -1) {
                ans.addAll(comp[d[v]]);
                v = to[v];
            }

            Collections.reverse(ans);
        }

        if (use[0]) {
            ans.add(0L);
        }
        println(ans.size());

        long prev = 1;
        for (long val : ans) {
            print(solve(prev, val, m));
            print(' ');
            prev = val;
        }
    }

    boolean skip() {
        while (hasNext()) {
            next();
        }
        return true;
    }

    int[][] nextMatrix(int n, int m) {
        int[][] matrix = new int[n][m];
        for (int i = 0; i < n; i++)
            for (int j = 0; j < m; j++)
                matrix[i][j] = nextInt();
        return matrix;
    }

    String next() {
        while (!tokenizer.hasMoreTokens())
            tokenizer = new StringTokenizer(nextLine());
        return tokenizer.nextToken();
    }

    boolean hasNext() {
        while (!tokenizer.hasMoreTokens()) {
            String line = nextLine();
            if (line == null) {
                return false;
            }
            tokenizer = new StringTokenizer(line);
        }
        return true;
    }

    int[] nextArray(int n) {
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = nextInt();
        }
        return array;
    }

    long[] nextLongArray(int n) {
        long[] array = new long[n];
        for (int i = 0; i < n; i++) {
            array[i] = nextLong();
        }
        return array;
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException err) {
            return null;
        }
    }

    public C(OutputStream outputStream) {
        super(outputStream);
    }

    static BufferedReader reader;
    static StringTokenizer tokenizer = new StringTokenizer("");
    static Random rnd = new Random();
    static boolean OJ;

    public static void main(String[] args) throws IOException {
        OJ = System.getProperty("ONLINE_JUDGE") != null;
        C solution = new C(System.out);
        if (OJ) {
            reader = new BufferedReader(new InputStreamReader(System.in));
            solution.run();
        } else {
            reader = new BufferedReader(new FileReader(new File(C.class.getName() + ".txt")));
            long timeout = System.currentTimeMillis();
            while (solution.hasNext()) {
                solution.run();
                solution.println();
                solution.println("----------------------------------");
            }
            solution.println("time: " + (System.currentTimeMillis() - timeout));
        }
        solution.close();
        reader.close();
    }
}