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 n, m;
int gcd(int a, int b) {
  if (b > a) return gcd(b, a);
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
int gcdExtended(int a, int b, int *x, int *y) {
  if (a == 0) {
    *x = 0, *y = 1;
    return b;
  }
  int x1, y1;
  int gcd = gcdExtended(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd;
}
int mod_inverse(int a, int m) {
  int x, y;
  int g = gcdExtended(a, m, &x, &y);
  if (g != 1) return 0;
  return (x % m + m) % m;
}
int inverse(int before, int after) {
  int g = gcd(before, m);
  before /= g;
  after /= g;
  int m0 = m / g;
  long long res = mod_inverse(before, m0);
  res = (res * (long long)after) % m0;
  return res;
}
vector<int> s[200005];
set<int> factor;
int main() {
  scanf("%d%d", &n, &m);
  if (m == 1) {
    cout << 1 << endl << 0 << endl;
    return 0;
  }
  vector<int> visit(m, false);
  for (int i = 1; i < m; i++) {
    int f = gcd(i, m);
    s[f].push_back(i);
    factor.insert(f);
  }
  for (int i = 0; i < m; i++) {
    if (s[i].size() == 0) continue;
  }
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    visit[a] = true;
    if (a) {
      vector<int> &cur = s[gcd(a, m)];
      cur.erase(find(cur.begin(), cur.end(), a));
    }
  }
  vector<int> factors;
  for (auto it = factor.begin(); it != factor.end(); it++) {
    factors.push_back(*it);
  }
  factors.push_back(m);
  vector<int> d(factors.size(), 0), t(factors.size(), -1);
  for (int i = factors.size() - 1; i > 0; i--) {
    for (int j = i - 1; j >= 0; j--) {
      int sm = factors[j], lg = factors[i];
      if (gcd(sm, lg) == sm && d[j] < d[i] + s[lg].size()) {
        d[j] = d[i] + s[lg].size();
        t[j] = i;
      }
    }
  }
  int start = 0;
  for (int i = 1; i < d.size(); i++) {
    if (d[start] < d[i]) {
      start = i;
    }
  }
  vector<int> pp;
  while (start != -1) {
    int curFactor = factors[start];
    for (int i = 0; i < s[curFactor].size(); i++) {
      pp.push_back(s[curFactor][i]);
    }
    start = t[start];
  }
  vector<int> sol;
  if (pp.size() > 0) {
    sol.push_back(pp[0]);
    for (int i = 1; i < pp.size(); i++) {
      sol.push_back(inverse(pp[i - 1], pp[i]));
    }
  }
  if (!visit[0]) sol.push_back(0);
  cout << sol.size();
  if (sol.size() > 0) cout << endl;
  int p;
  for (int i = 0; i < sol.size(); i++) {
    printf("%d ", sol[i]);
  }
  return 0;
}
