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 n, m, k, occ, id[200005], be[200005], pi[200005], num[200005],
    sum[200005], dis[200005], ru[200005], pre[200005], tot, cnt, h[200005], mx,
    now, mi, sta[200005], top, vis[200005];
vector<long long> vec[200005];
struct l1 {
  long long to, next;
} p[400005];
void add(long long x, long long y) {
  cnt++;
  p[cnt].to = y;
  p[cnt].next = h[x];
  h[x] = cnt;
}
void exgcd(long long x, long long y, long long &a, long long &b, long long v) {
  if (!y) {
    a = v / x;
    return;
  }
  exgcd(y, x % y, a, b, v);
  long long t = b;
  b = a - b * (x / y);
  a = t;
}
long long solve(long long x, long long y) {
  long long a = 0, b = 0;
  exgcd(x, m, a, b, y);
  return (a % m + m) % m;
}
long long gcd(long long x, long long y) {
  if (!y) return x;
  return gcd(y, x % y);
}
void dfs(long long x, long long lim, long long v) {
  if (x == tot + 1) {
    id[v] = ++occ;
    be[occ] = v;
    return;
  }
  if (lim < num[x]) dfs(x, lim + 1, v * pi[x]);
  dfs(x + 1, 0, v);
}
int main() {
  scanf("%lld%lld", &n, &m);
  k = m;
  for (long long i = 1; i <= n; i++) {
    long long x;
    scanf("%lld", &x);
    vis[x] = 1;
  }
  for (long long i = 2; i <= sqrt(k); i++) {
    if (k % i == 0) {
      tot++;
      pi[tot] = i;
      while (k % i == 0) k /= i, num[tot]++;
    }
  }
  if (k > 1) tot++, pi[tot] = k, num[tot] = 1;
  dfs(1, 0, 1);
  for (long long i = 1; i <= m; i++) {
    if (vis[i % m]) continue;
    long long x = gcd(i, m);
    sum[id[x]]++;
    vec[id[x]].push_back(i);
  }
  for (long long i = 1; i <= m; i++) {
    if (id[i]) {
      for (long long t = 1; t <= tot; t++) {
        long long nex = i * pi[t];
        if (m % nex == 0) {
          add(id[nex], id[i]);
          ru[id[i]]++;
        }
      }
    }
  }
  queue<long long> q;
  for (long long i = 1; i <= occ; i++) {
    if (!ru[i]) q.push(i);
  }
  while (!q.empty()) {
    long long x = q.front();
    q.pop();
    dis[x] += sum[x];
    for (long long i = h[x]; i; i = p[i].next) {
      long long y = p[i].to;
      ru[y]--;
      if (dis[y] < dis[x]) dis[y] = dis[x], pre[y] = x;
      if (!ru[y]) q.push(y);
    }
  }
  for (long long i = 1; i <= occ; i++) {
    if (dis[i] > mx) mx = dis[i], now = i;
  }
  sta[0] = 1;
  mi = 1;
  while (now) {
    for (long long t = 0; t < vec[now].size(); t++) {
      sta[++top] = solve(mi, vec[now][t]);
      mi = vec[now][t];
    }
    now = pre[now];
  }
  printf("%lld\n", top);
  for (long long i = 1; i <= top; i++) printf("%lld ", sta[i]);
}
