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.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.List;
 import java.util.*;
 public class realfast implements Runnable 
  {
    private static final int INF = (int) 1e9;
    long in= 1000000007;
    long fac[]= new long[1000001];
    long inv[]=new long[1000001];
    public  void solve() throws IOException 
    {
 
        //int t = readInt();



        int n = readInt();
        int m = readInt();

        boolean available[]=new boolean[m+1];

        for(int i=1;i<=n;i++)
        {
            int a= readInt();

            available[a]= true;
        }
        //int arr[]=new int[m];


        ArrayList<Integer> arr[]=new ArrayList[m+1];


        for(int i=1;i<=m;i++)
        {
            arr[i]= new ArrayList<Integer>();
        }


        int mod[]=new int[m+1];
        int gcd[]=new int[m+1];

        for(int i=1;i<=m-1;i++)
        {
             int gcd1= gcd(i,m);

             gcd[i]= gcd1;

             if(gcd1!=1)
                continue;

             mod[i]= modInverse(i,m);

        }

       // System.out.println("realcheck  "+modInverse(7,10));
        for(int i=1;i<=m-1;i++)
        {
            if(available[i])
                    continue;
            int gcd1 = gcd(i,m);
            // System.out.println(gcd1);
            arr[gcd1].add(i);

        }


        ArrayList<edge> e = new ArrayList<edge>();

        for(int i =1;i<m;i++)
        {
            if(arr[i].size()>0)
               e.add(new edge(arr[i].size(),i));
        }


        Collections.sort(e);


        int dp[]=new int[e.size()];


        int next[]=new int[e.size()];



          Arrays.fill(next,-1);

          int r = e.size();
          for(int i=r-1;i>=0;i--)
          {
            int v = e.get(i).v;
            int u = e.get(i).u;
            dp[i]=u;
            //int gcd = gcd[u];
            for(int  j=i+1;j<r;j++ )
            {
                int v1 = e.get(j).v;
                if(gcd[v1]%gcd[v]==0)
                {
                    //dp[i]= Math.min(v+ dp[j],dp[i]);
                    if(dp[j]+u>dp[i])
                    {
                         dp[i]= dp[j]+u;
                         next[i]= j ;
                    }
                }
            }
          }

          int max =0;

          int start=-1;

          for(int i =0;i<r;i++)
          {
            if(dp[i]>max)
            {
                max =dp[i];
                start=i;
            }
          }
          //System.out.println("eyo");
          ArrayList<Integer> res = new ArrayList<Integer>();
          int last =1;
          while(start!=-1)
          {
                 int v = e.get(start).v;
                  for(int j = 0;j<arr[v].size();j++)
                  {
                       int val = arr[v].get(j);

                      // int lo = gcd[val];
                       int lo1= gcd[last];
                       //  System.out.println(last+" "+val);// System.out.println(last/lo1+" ");
                       long gal = modInverse(last/lo1,m/lo1);
                        //  System.out.println(gal);
                        //gal = (gal*lo1);

                        gal = (gal*(val/lo1))%m;
                       // System.out.println(gal);

                        last= val;
                       
                        res.add((int)gal);

                  }

                  start= next[start];

          }

          if(!available[0])
          {
             res.add(0);
          }




          out.println(res.size());


          for(int i =0;i<res.size();i++)
            out.print(res.get(i)+" ");

          out.println();







      
       
    }


    int modInverse(int a, int m)
    {
        int m0 = m;
        int y = 0, x = 1;
 
        if (m == 1)
            return 0;
 
        while (a > 1) {
            // q is quotient
            int q = a / m;
 
            int t = m;
 
            // m is remainder now, process
            // same as Euclid's algo
            m = a % m;
            a = t;
            t = y;
 
            // Update x and y
            y = x - q * y;
            x = t;
        }
 
        // Make x positive
        if (x < 0)
            x += m0;
 
        return x;
    }
 
    
    public int value (int seg[], int left , int right ,int index, int l, int r)
    {
            
            if(left>right)
            {
              return -100000000;
            }
            if(right<l||left>r)
                return -100000000;
            if(left>=l&&right<=r)
                return seg[index];
            int mid = left+(right-left)/2;
            int val = value(seg,left,mid,2*index+1,l,r);
            int val2 = value(seg,mid+1,right,2*index+2,l,r);
            return Math.max(val,val2);
 
    }
   
    public int gcd(int a , int b )
    {
      if(a<b)
      {
        int t =a;
        a=b;
        b=t;
      }
      if(a%b==0)
        return b ;
      return gcd(b,a%b);
    }
    public long pow(long n , long p,long m)
    {
         if(p==0)
            return 1;
        long val = pow(n,p/2,m);;
        val= (val*val)%m;
        if(p%2==0)
            return val;
        else
            return (val*n)%m;
    }
    
    
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    public static void main(String[] args) {
        new Thread(null, new realfast(), "", 128 * (1L << 20)).start();
    }
 
    private static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    private BufferedReader reader;
    private StringTokenizer tokenizer;
    private PrintWriter out;
 
    @Override
    public void run() {
        try {
            if (ONLINE_JUDGE || !new File("input.txt").exists()) {
                reader = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                reader = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            }
            solve();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            try {
                reader.close();
            } catch (IOException e) {
                // nothing
            }
            out.close();
        }
    }
 
    private String readString() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
 
    @SuppressWarnings("unused")
    private int readInt() throws IOException {
        return Integer.parseInt(readString());
    }
 
    @SuppressWarnings("unused")
    private long readLong() throws IOException {
        return Long.parseLong(readString());
    }
 
    @SuppressWarnings("unused")
    private double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }
}
class edge implements Comparable<edge>{
    int u ;
    int v;
    int val;
    
    edge(int u, int v)
    {
       this.u=u;
       this.v=v;
       this.val= val;
    }
    public int compareTo(edge e)
    {
        return this.v-e.v;
    }
}