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;
using ll = long long;
int gcd(int a, int b) {
  while (b > 0) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
ll gcd2(ll a, ll b, ll &x, ll &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  ll x1, y1, d;
  d = gcd2((b % a), a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
ll divide(ll b, ll a, ll m) {
  ll x, y;
  ll d = gcd2(a, m, x, y);
  assert(b % d == 0);
  a = a / d;
  m = m / d;
  b = b / d;
  d = gcd2(a, m, x, y);
  x *= b;
  ll x1 = (x % m);
  if (x1 < 0) x1 += m;
  return x1;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<bool> bad(m);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    bad[x] = true;
  }
  map<int, vector<int> > gr;
  for (int i = 1; i <= m; i++) {
    if (!bad[i % m]) gr[gcd(i, m)].push_back(i);
  }
  map<int, vector<int> > graph;
  for (auto elem1 : gr) {
    (void)graph[elem1.first];
    for (auto elem2 : gr) {
      if (elem1.first % elem2.first == 0 && elem1.first != elem2.first) {
        graph[elem2.first].push_back(elem1.first);
      }
    }
  }
  map<int, int> dp;
  map<int, int> pred;
  for (auto it = graph.rbegin(); it != graph.rend(); it++) {
    auto elem = *it;
    int u = elem.first;
    dp[u] = gr[u].size();
    pred[u] = -1;
    for (int v : elem.second) {
      if (dp[v] + (int)gr[u].size() > dp[u]) {
        dp[u] = dp[v] + (int)gr[u].size();
        pred[u] = v;
      }
    }
  }
  int last = -1;
  for (auto elem : dp) {
    if (last == -1 || elem.second > dp[last]) {
      last = elem.first;
    }
  }
  vector<int> groups;
  while (last != -1) {
    groups.push_back(last);
    last = pred[last];
  }
  vector<int> ans;
  for (int i = 0; i < (int)groups.size(); i++) {
    int now_v = groups[i];
    if (i > 0) {
      int prev_v = groups[i - 1];
      ans.push_back(divide(gr[now_v][0], gr[prev_v].back(), m));
    } else {
      ans.push_back(gr[now_v][0] % m);
    }
    for (int j = 1; j < (int)gr[now_v].size(); j++) {
      ans.push_back(divide(gr[now_v][j], gr[now_v][j - 1], m));
    }
  }
  cout << (int)ans.size() << endl;
  for (int i = 0; i < (int)ans.size(); i++) {
    cout << ans[i] << ' ';
  }
  cout << endl;
  return 0;
}
