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;
struct bkn {
  long long to, next, v;
} e[2 * 200020];
long long head[200020], tot = 0, ss = 1, fa[200020], vis[200020], ha[200020],
                        sum[200020], dp[200020], st[200020], q[200020];
vector<long long> f[200020];
long long exgcd(long long &x, long long &y, long long a, long long b) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  } else {
    long long q = exgcd(x, y, b, a % b);
    long long t = x;
    x = y;
    y = t - a / b * y;
    return q;
  }
}
void add(long long a, long long b) {
  e[tot].to = b;
  e[tot].next = head[a];
  head[a] = tot++;
}
void dfs(int x) {
  vis[x] = 1;
  long long i;
  if (head[x] != -1)
    for (i = head[x]; i != -1; i = e[i].next) {
      long long y = e[i].to;
      if (!vis[y]) dfs(y);
    }
  st[ss++] = x;
}
void dpvoid() {
  long long i, j;
  long long mx = 0, mxn;
  for (i = ss - 1; i >= 1; i--) {
    long long x = st[i];
    if (dp[x] == 0) dp[x] = sum[q[x]];
    if (head[x] != -1)
      for (j = head[x]; j != -1; j = e[j].next) {
        long long y = e[j].to;
        if (dp[y] < sum[q[y]] + dp[x]) {
          fa[y] = x;
          dp[y] = sum[q[y]] + dp[x];
        }
      }
    if (dp[x] > mx) {
      mx = dp[x];
      mxn = x;
    }
  }
  cout << mx << endl;
  ss = 1;
  i = mxn;
  while (i) {
    st[ss++] = i;
    i = fa[i];
  }
  ss--;
}
int main() {
  long long n, m, i, j;
  long long x, y;
  cin >> n >> m;
  memset(head, -1, sizeof(head));
  for (i = 1; i <= n; i++) {
    cin >> x;
    ha[x] = 1;
  }
  int t = 1;
  for (i = 0; i <= m - 1; i++) {
    if (ha[i]) continue;
    long long g = exgcd(x, y, i, m);
    if (sum[g] == 0) q[t++] = g;
    sum[g]++;
    f[g].push_back(i);
  }
  for (i = 1; i < t; i++) {
    for (j = 1; j < t; j++) {
      if (i == j) continue;
      if (q[i] % q[j] == 0) {
        add(i, j);
      }
    }
  }
  for (i = 1; i < t; i++) {
    if (!vis[i]) dfs(i);
  }
  dpvoid();
  long long p = 1;
  for (i = 1; i <= ss; i++) {
    for (long long it = 0; it < f[q[st[i]]].size(); it++) {
      long long g = exgcd(x, y, p, m);
      x = x * (f[q[st[i]]][it]) / g;
      if (x < 0) {
        x = -x;
        x %= m / g;
        x = m / g - x;
      }
      p = f[q[st[i]]][it];
      x %= m;
      cout << x << ' ';
    }
  }
  cout << endl;
}
