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.*;

public class C {

    final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void solve() throws IOException {
        int n = readInt();
        int m = readInt();
        int[] bans = readArr(n);

        List<Integer> divisorsList = new ArrayList<>();
        for (int d = 1; d * d <= m; ++d) {
            if (m % d == 0 ){
                divisorsList.add(d);
                if (d * d != m) divisorsList.add(m / d);
            }
        }

        int[] divisors = new int[divisorsList.size()];
        for (int i = 0; i < divisorsList.size(); ++i) {
            divisors[i] = divisorsList.get(i);
        }

        Arrays.sort(divisors);

        int[] gcds = new int[m];
        for (int i = 0; i < m; ++i) {
            gcds[i] = gcd(i, m);
        }

        int[] sizes = new int[m + 1];
        for (int gcd : gcds) {
            sizes[gcd]++;
        }

        for (int ban : bans) {
            sizes[gcds[ban]]--;
        }

        int[] dp = new int[divisors.length];
        Arrays.fill(dp, -1);

        int[] parents = new int[dp.length];
        Arrays.fill(parents, -1);

        for (int i = 0; i < divisors.length; ++i) {
            int divisor = divisors[i];
            if (sizes[divisor] == 0) continue;

            dp[i] = 0;
            for (int prev = 0; prev < i; ++prev) {
                int prevDivisor = divisors[prev];
                if (divisor % prevDivisor == 0) {
                    if (dp[prev] > dp[i]) {
                        parents[i] = prev;
                        dp[i] = dp[prev];
                    }
                }
            }

            dp[i] += sizes[divisor];
        }

        int maxDp = 0;
        int maxDpIndex = -1;

        for (int i = 0; i < divisors.length; ++i) {
            if (dp[i] > maxDp) {
                maxDp = dp[i];
                maxDpIndex = i;
            }
        }

        List<Integer>[] numbers = new List[m + 1];
        for (int i = 0; i < divisors.length; ++i) {
            numbers[divisors[i]] = new ArrayList<>();
        }

        boolean[] banned = new boolean[m];
        for (int ban : bans) {
            banned[ban] = true;
        }

        for (int i = 0; i < m; ++i) {
            numbers[gcds[i]].add(i);
        }

        List<Integer> way = new ArrayList<>();
        for (int cur = maxDpIndex; cur > -1; ) {
            way.add(cur);
            cur = parents[cur];
        }

        Collections.reverse(way);

        List<Integer> answer = new ArrayList<>();

        boolean[] used = new boolean[m];

        int curPrefix = 1;
        for (int divisorIndex : way) {
            int divisor = divisors[divisorIndex];
            if (sizes[divisor] == 0) {
                continue;
            }
            boolean was = false;
            for (int firstValue = 0; firstValue < m; ++firstValue) {
                int nextPrefix = mult(curPrefix, firstValue, m);
                if (!banned[nextPrefix] && !used[nextPrefix] && gcds[nextPrefix] == divisor) {

                    if (nextPrefix == 0) {
                        nextPrefix = 0;
                    }

                    curPrefix = nextPrefix;
                    used[curPrefix] = true;

                    answer.add(firstValue);
                    was = true;
                    break;
                }
            }

            if (!was) {
                throw new RuntimeException();//continue;
            }

            if (curPrefix == 0) {
                curPrefix = 0;
            }

            for (int value : numbers[divisor]) {
                if (used[value]) continue;
                if (banned[value]) continue;

                if (value == 0) {
                    value = 0;
                }

                int nextPrefix = value;

                int need = mult(nextPrefix / divisor, inverse(curPrefix / divisor, m / divisor), m / divisor);
                if (need == 0) {
                    need = m / divisor;
                }
                answer.add(need);

                curPrefix = nextPrefix;
                used[nextPrefix] = true;

                if (curPrefix == 0) break;
            }

            if (curPrefix == 0) break;
        }

        out.println(answer.size());
        for (int value : answer) {
            out.print(value + " ");
        }
        out.println();
    }

    int mult(int a, int b, int m) {
        return (int)((1L * a * b) % m);
    }

    int inverse(int a, int m) {
        long[] gcdEx = gcdEx(a, m);

        int x = (int)(gcdEx[1] % m);
        if (x < 0) x = (x + m) % m;
        if (x == 0) x += m;

        return x;
    }

    long[] gcdEx(int a, int b) {
        if (a == 0) {
            return new long[] { b, 0, 1 };
        } else {
            long[] gcdEx = gcdEx(b % a, a);

            long nextX = gcdEx[2] - gcdEx[1] * (b / a);
            long nextY = gcdEx[1];

            gcdEx[1] = nextX;
            gcdEx[2] = nextY;

            return gcdEx;
        }
    }

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

    void init() throws FileNotFoundException {
        if (ONLINE_JUDGE) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    int[] readArr(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = readInt();
        }
        return res;
    }

    long[] readArrL(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = readLong();
        }
        return res;
    }

    public static void main(String[] args) {
        new C().run();
    }

    public void run() {
        try {
            long t1 = System.currentTimeMillis();
            init();
            solve();
            out.close();
            long t2 = System.currentTimeMillis();
            System.err.println("Time = " + (t2 - t1));
        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }
}