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, num[200010], nxewt[200010], dist[200010], phi;
vector<long long> v[200010], g[200010], res;
bool ok[200010], vis[200010];
inline long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long PoWt(long long aa, long long bb) {
  long long ans = 1;
  while (bb > 1) {
    if (bb % 2 == 1) ans = (ans * aa) % m;
    bb /= 2;
    aa = (aa * aa) % m;
  }
  ans = (ans * aa) % m;
  return ans;
}
long long GeTg(long long aaa, long long bbb) {
  long long ggg = gcd(aaa, bbb);
  aaa /= ggg;
  bbb /= ggg;
  return bbb * PoWt(aaa, phi - 1) % m;
}
long long dfs(long long u) {
  dist[u] = num[u];
  long long mx = 0;
  for (long long i = 0; i < g[u].size(); i++) {
    long long pos = g[u][i];
    long long val;
    if (dist[pos] != 0)
      val = dist[pos];
    else {
      vis[pos] = 1;
      val = dfs(pos);
    }
    if (val > mx) {
      mx = val;
      nxewt[u] = pos;
    }
  }
  dist[u] += mx;
  return dist[u];
}
signed main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  long long rr = m;
  phi = m;
  for (long long i = 2; i <= m; i++) {
    if (rr % i == 0) {
      phi = phi / i * (i - 1);
      while (rr % i == 0) rr /= i;
    }
  }
  for (long long i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    ok[x] = 1;
  }
  for (long long i = 0; i < m; i++)
    if (!ok[i]) {
      long long val = gcd(m, i);
      v[val].push_back(i);
    }
  for (long long i = 1; i <= m; i++)
    if (v[i].size() > 0) {
      num[i] = v[i].size();
    }
  for (long long i = 1; i <= m; i++)
    if (v[i].size() > 0) {
      for (long long j = 1; j <= m; j++)
        if (v[j].size() > 0) {
          if (i == j) continue;
          long long val1 = gcd(i, m), val2 = gcd(j, m);
          if (val2 % val1 == 0) {
            g[i].push_back(j);
          }
        }
    }
  for (long long i = 1; i <= m; i++) nxewt[i] = -1;
  for (long long i = 1; i <= m; i++)
    if (v[i].size() > 0 && !vis[i]) {
      vis[i] = 1;
      dfs(i);
    }
  long long sad = 1;
  while (1) {
    if (sad == -1) break;
    for (long long ii = 0; ii < v[sad].size(); ii++) {
      res.push_back(v[sad][ii]);
    }
    if (sad == -1) break;
    sad = nxewt[sad];
  }
  cout << res.size() << endl;
  cout << res[0];
  long long yut = res[0];
  for (long long i = 0; i < res.size() - 1; i++) {
    long long val = res[i], cur = res[i + 1];
    long long w = GeTg(val, cur);
    cout << " " << w;
  }
  cout << endl;
  return 0;
}
