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;
const long long M = 1e9 + 7;
const long long mod = 998244353;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
long long binpow(long long a, long long b, long long m) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
void extended_gcd(long long a, long long b, long long &x, long long &y) {
  long long u = 0, v = 1;
  x = 1;
  y = 0;
  while (b) {
    long long q = a / b;
    y = y - v * q;
    x = x - u * q;
    a = a - b * q;
    swap(a, b);
    swap(u, x);
    swap(v, y);
  }
}
long long find_inverse(long long a, long long m) {
  long long x, y;
  extended_gcd(a, m, x, y);
  x = (x % m + m) % m;
  return x;
}
int p[200200];
void solve() {
  int n, m;
  cin >> n >> m;
  for (int i = (0); i < (n); i++) {
    int x;
    cin >> x;
    p[x] = 1;
  }
  vector<int> gps[m];
  for (int i = 1; i < m; i++) {
    if (p[i]) continue;
    gps[gcd(i, m)].push_back(i);
  }
  vector<int> dp(m), to(m), in(m);
  for (int i = 1; i < m; i++) {
    if (gps[i].size() == 0) continue;
    for (int j = i + i; j < m; j += i) {
      if (gps[j].size()) in[j]++;
    }
  }
  queue<int> q;
  int res = -1, st;
  for (int i = 1; i < m; i++) {
    if (gps[i].size() && in[i] == 0) {
      q.push(i);
      dp[i] = gps[i].size();
      res = gps[i].size();
      st = i;
    }
  }
  if (res == -1) {
    if (p[0]) {
      cout << 0 << "\n";
    } else
      cout << 1 << "\n" << 0 << "\n";
    exit(0);
  }
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    if (dp[u] > res) {
      res = dp[u];
      st = u;
    }
    for (int v = u + u; v < m; v += u) {
      if (gps[v].size()) {
        in[v]--;
        if (dp[v] < dp[u] + gps[v].size()) {
          dp[v] = dp[u] + gps[v].size();
          to[v] = u;
        }
        if (in[v] == 0) {
          q.push(v);
        }
      }
    }
  }
  vector<int> ans;
  long long sz = 0;
  while (st != 0) {
    for (int x : gps[st]) ans.push_back(x), sz++;
    st = to[st];
  }
  reverse(ans.begin(), ans.end());
  if (!p[0]) {
    sz++;
  }
  cout << sz << "\n";
  int prev = 1;
  for (int x : ans) {
    long long g = gcd(prev, m);
    if (g != 1) {
      prev /= g;
      x /= g;
    }
    cout << ((long long)x * find_inverse(prev, m / g)) % m << " ";
    prev = x * g;
  }
  if (!p[0]) cout << 0;
  cout << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}
