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].
#include <bits/stdc++.h>
using namespace std;
long long read() {
  char c = getchar();
  long long u = 0, f = 1;
  while (c != '-' && (c < '0' || '9' < c)) c = getchar();
  if (c == '-') {
    f = -1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    u = u * 10 + c - '0';
    c = getchar();
  }
  return u * f;
}
char readc() {
  for (;;) {
    char c = getchar();
    if ('A' <= c && c <= 'Z' || 'a' <= c && c <= 'z') return c;
  }
}
int read_digit() {
  for (;;) {
    char c = getchar();
    if ('0' <= c && c <= '9') return c - '0';
  }
}
inline int max(int a, int b) { return a > b ? a : b; }
inline int min(int a, int b) { return a < b ? a : b; }
template <typename T>
inline void updmax(T &a, T b) {
  if (b > a) a = b;
}
template <typename T>
inline void updmin(T &a, T b) {
  if (b < a) a = b;
}
inline void swap(int &a, int &b) {
  int t = a;
  a = b;
  b = t;
}
inline void fileio(string s) {
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
int exgcd(int a, int b, int &x, int &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  int q = exgcd(b, a % b, y, x);
  y -= a / b * x;
  return q;
}
int n, m;
int forb[200100], forbiden[200100], e[200100], x[200100];
vector<int> num[200100];
long long dp[200100];
int pre[200100];
vector<int> fac[200100], ans;
int main() {
  n = read();
  m = read();
  for (int i = 0; i < n; i++) {
    forb[i] = read();
    forbiden[forb[i]] = 1;
  }
  for (int i = 1; i < m; i++) {
    int y;
    e[i] = exgcd(i, m, x[i], y);
    while (x[i] < 0) x[i] += m;
    if (forbiden[i]) continue;
    num[e[i]].push_back(i);
  }
  dp[1] = 0;
  pre[1] = -1;
  int mxid = 1;
  for (int i = 1; i <= m; i++) {
    dp[i] += num[i].size();
    for (int j = i * 2; j < m; j += i) {
      if (dp[i] > dp[j]) {
        pre[j] = i;
        dp[j] = dp[i];
      }
    }
    if (dp[i] > dp[mxid]) mxid = i;
  }
  vector<int> seq;
  seq.clear();
  while (mxid >= 0) {
    seq.push_back(mxid);
    mxid = pre[mxid];
  }
  reverse(seq.begin(), seq.end());
  long long c = 1;
  for (int i = 0; i < seq.size(); i++) {
    int u = seq[i];
    for (int j = 0; j < num[u].size(); j++) {
      int v = num[u][j];
      int k = v / e[c];
      int u2 = (long long)x[c] * k % m;
      ans.push_back(u2);
      c = c * ans.back() % m;
    }
  }
  if (forbiden[0] == 0) ans.push_back(0);
  printf("%d\n", (int)ans.size());
  for (int i = 0; i < ans.size(); i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
