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;
int m, n;
bool forbid[200000];
vector<pair<int, int>> decomp;
map<int, vector<int>> dp;
map<int, bool> calced;
map<int, vector<int>> g;
int gcd(int p, int q) {
  if (q == 0) return p;
  return gcd(q, p % q);
}
vector<pair<int, int>> prime_decomposition(int nn) {
  vector<pair<int, int>> ans;
  for (int p = 2; p * p <= nn; p++) {
    int a = 0;
    while (nn % p == 0) {
      nn /= p;
      a++;
    }
    if (a) ans.push_back({p, a});
  }
  if (nn > 1) ans.push_back({nn, 1});
  return ans;
}
int hash_decomp(vector<pair<int, int>> decomp) {
  int ans = 0;
  for (auto e : decomp) {
    ans = ans * 17 + e.second;
  }
  return ans;
}
int recov(vector<pair<int, int>> dec) {
  int ans = 1;
  for (auto e : dec) {
    for (int i = 0; i < e.second; i++) ans *= e.first;
  }
  return ans;
}
vector<int> work(vector<pair<int, int>> dec) {
  int h = hash_decomp(dec);
  if (calced[h]) return dp[h];
  bool all_zero = true;
  for (auto e : dec)
    if (e.second) all_zero = false;
  if (all_zero) {
    calced[h] = true;
    dp[h] = g[recov(dec)];
    return dp[h];
  }
  vector<int> ans;
  for (int i = 0; i < dec.size(); i++) {
    if (dec[i].second) {
      dec[i].second--;
      vector<int> temp = work(dec);
      if (ans.size() <= temp.size()) ans = temp;
      dec[i].second++;
    }
  }
  for (int e : g[recov(dec)]) ans.push_back(e);
  calced[h] = true;
  dp[h] = ans;
  return ans;
}
void compute_g() {
  for (int i = 1; i < m; i++) {
    if (!forbid[i]) {
      g[gcd(i, m)].push_back(i);
    }
  }
}
long long extended_euclid(long long p, long long q, long long &x,
                          long long &y) {
  if (q == 0) {
    x = 1;
    y = 0;
    return p;
  }
  long long gcd = extended_euclid(q, p % q, y, x);
  y -= p / q * x;
  return gcd;
}
long long line_mode_equation(long long a, long long b, long long nn) {
  long long x, y;
  long long d = extended_euclid(a, nn, x, y);
  long long ans;
  if (b % d == 0) {
    x %= nn;
    x += nn;
    x %= nn;
    ans = (x * (b / d) % (nn / d) + nn / d) % (nn / d);
    for (int i = 1; i < d; i++) {
      if (ans > 0 && ans < nn) return ans;
      ans = (ans + nn / d);
    }
  }
  return ans;
}
int main() {
  cin >> n >> m;
  while (n--) {
    int s;
    cin >> s;
    forbid[s] = true;
  }
  if (m == 0) {
    cout << 0 << endl << endl;
    return 0;
  }
  decomp = prime_decomposition(m);
  compute_g();
  vector<int> ans = work(decomp);
  int len = ans.size();
  if (forbid[0] == false) len++;
  cout << len << endl;
  if (ans.size()) {
    cout << ans[0] << ' ';
    for (int i = 1; i < ans.size(); i++) {
      cout << line_mode_equation(ans[i - 1], ans[i], m) << ' ';
    }
  }
  if (forbid[0] == false) cout << 0 << ' ';
  cout << endl;
  return 0;
}
