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;
template <typename T>
using maxHeap = priority_queue<T, vector<T>, less<T>>;
template <typename T>
using minHeap = priority_queue<T, vector<T>, greater<T>>;
template <typename Iter>
ostream& _out(ostream& s, Iter b, Iter e) {
  s << "[";
  for (auto it = b; it != e; it++) s << (it == b ? "" : " ") << *it;
  s << "]";
  return s;
}
template <typename A, typename B>
ostream& operator<<(ostream& s, const pair<A, B>& p) {
  return s << "(" << p.first << "," << p.second << ")";
}
template <typename T>
ostream& operator<<(ostream& s, const vector<T>& c) {
  return _out(s, begin(c), end(c));
}
bool debug = 0;
template <typename T>
void DEBUG(const T& x) {
  if (debug) cerr << x;
}
template <typename T, typename... Args>
void DEBUG(const T& head, const Args&... tail) {
  if (debug) {
    cerr << head;
    DEBUG(tail...);
  }
}
const int N = 200000 + 5;
vector<int> DAG[N];
vector<int> val[N];
bool erased[N], dped[N], pushed[N];
int dp[N], ori[N];
inline int gcd(int a, int b) {
  if (b) return gcd(b, a % b);
  return a;
}
pair<long long, long long> exgcd(int a, int b, int m) {
  if (b == 0) return {1, 0};
  pair<long long, long long> q = exgcd(b, a % b, m);
  while (q.second < 0) q.second += m;
  while (q.first < 0) q.first += m;
  return {q.second, q.first - q.second * (a / b)};
}
int dfs(int);
int main(int argc, char* argv[]) {
  if (argc > 1 and string(argv[1]) == "-D") debug = 1;
  if (!debug) {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
  }
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    erased[x] = true;
  }
  if (!erased[0]) val[0].push_back(0);
  for (int i = 1; i < m; i++) {
    if (erased[i]) continue;
    val[gcd(i, m)].push_back(i);
  }
  for (int i = 1; i < m; i++) {
    for (int j = 0; i * j < m; j++) {
      if (j == 1) continue;
      DAG[i].push_back(j * i);
    }
  }
  int tot = 0, wh = -1;
  for (int i = 0; i < m; i++) {
    int tmp = dfs(i);
    if (tmp > tot) {
      wh = i;
      tot = tmp;
    }
  }
  cout << dp[wh] << '\n';
  vector<int> from, ans;
  while (!pushed[wh]) {
    pushed[wh] = true;
    from.push_back(wh);
    wh = ori[wh];
  }
  int pre = 1, prei = 1;
  for (auto i : from) {
    for (int _ = 0; _ < (int)(val[i].size()); _++) {
      int j = val[i][_];
      long long moni = exgcd(pre, m, m).first;
      j /= prei;
      j = j * moni % m;
      ans.push_back(j);
      pre = val[i][_];
      prei = i;
    }
  }
  for (int i = 0; i < (int)(ans.size()); i++)
    cout << ans[i] << " \n"[i == (int)(ans.size()) - 1];
  return 0;
}
int dfs(int x) {
  if (dped[x]) return dp[x];
  dped[x] = true;
  auto& ret = dp[x];
  ret = 0;
  ori[x] = x;
  for (auto i : DAG[x]) {
    int sub = dfs(i);
    if (sub > ret) {
      ori[x] = i;
      ret = sub;
    }
  }
  ret += (int)(val[x].size());
  return ret;
}
