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 gi() {
  int a;
  scanf("%d", &a);
  return a;
}
long long gli() {
  long long a;
  scanf("%I64d", &a);
  return a;
}
int fct[200004];
int gcd(int a, int b) {
  if (a == 0) return b;
  if (b < a) return gcd(b, a);
  return gcd(b % a, a);
}
struct x_ {
  int mx;
  int pr;
  vector<int> v;
};
int pw(int a, int b, int m) {
  if (b == 0) return 1;
  long long v = pw(a, b / 2, m);
  if (b % 2) return (v * v * a) % m;
  return (v * v) % m;
}
int t;
int div(int c, long long v, int n) {
  int g = gcd(c, n);
  c /= g;
  n /= g;
  v /= g;
  return (v * pw(c, t - 1, n)) % n;
}
int ispr(int a) {
  if (a == 1) return 0;
  if (a > 2 && a % 2 == 0) return 0;
  for (int i = 3; i * i <= a; i++)
    if (a % i == 0) return 0;
  return 1;
}
int main() {
  int n = gi();
  int m = gi();
  t = m;
  map<int, x_> mp;
  map<int, x_>::iterator it, it2;
  unordered_set<int> s_;
  for (int i = 0; i < n; i++) s_.insert(gi());
  int inc0 = (s_.find(0) == s_.end() ? 1 : 0);
  int f = 0;
  for (int i = 1; i < m; i++) {
    if (s_.find(i) == s_.end()) mp[gcd(i, m)].v.push_back(i);
    if (i > 1 && m % i == 0) {
      fct[f++] = i;
      if (ispr(i)) t = t / i * (i - 1);
    }
  }
  if (ispr(m)) t = m - 1;
  int gmx = 0, gpr = -1;
  for (it = mp.begin(); it != mp.end(); it++) {
    int v = it->first;
    int pr = -1;
    int mx = 0;
    for (int j = 0; j < f && fct[j] <= v; j++)
      if (v % fct[j] == 0 && (it2 = mp.find(v / fct[j])) != mp.end()) {
        if (it2->second.mx > mx) {
          pr = it2->first;
          mx = it2->second.mx;
        }
      }
    it->second.mx = mx + it->second.v.size();
    it->second.pr = pr;
    if (it->second.mx > gmx) {
      gmx = it->second.mx;
      gpr = v;
    }
  }
  stack<int> s;
  while (gpr != -1) {
    it = mp.find(gpr);
    for (int i = 0; i < it->second.v.size(); i++) s.push(it->second.v[i]);
    gpr = it->second.pr;
  }
  printf("%d\n", int(s.size() + inc0));
  int c = 1;
  while (s.size()) {
    int v = s.top();
    s.pop();
    printf("%d ", div(c, v, m));
    c = v;
  }
  if (inc0)
    printf("0\n");
  else
    printf("\n");
  return 0;
}
