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>
inline char read() {
  static const int IN_LEN = 1024 * 1024;
  static char buf[IN_LEN], *s, *t;
  if (s == t) {
    t = (s = buf) + fread(buf, 1, IN_LEN, stdin);
    if (s == t) return -1;
  }
  return *s++;
}
template <class T>
inline void R(T &x) {
  static char c;
  static bool iosig;
  for (c = read(), iosig = false; !isdigit(c); c = read()) {
    if (c == -1) return;
    if (c == '-') iosig = true;
  }
  for (x = 0; isdigit(c); c = read()) x = ((x << 2) + x << 1) + (c ^ '0');
  if (iosig) x = -x;
}
const int OUT_LEN = 1024 * 1024;
char obuf[OUT_LEN], *oh = obuf;
inline void write_char(char c) {
  if (oh == obuf + OUT_LEN) fwrite(obuf, 1, OUT_LEN, stdout), oh = obuf;
  *oh++ = c;
}
template <class T>
inline void W(T x) {
  static int buf[30], cnt;
  if (x == 0)
    write_char('0');
  else {
    if (x < 0) write_char('-'), x = -x;
    for (cnt = 0; x; x /= 10) buf[++cnt] = x % 10 + 48;
    while (cnt) write_char(buf[cnt--]);
  }
}
inline void flush() { fwrite(obuf, 1, oh - obuf, stdout); }
const int MAXN = 200000;
long long x, y;
long long next_num[MAXN], max_size[MAXN];
std::set<long long> s[MAXN];
std::vector<long long> ori_num;
std::vector<long long> new_num;
inline void ext_gcd(long long a, long long b, long long &x, long long &y) {
  b ? (ext_gcd(b, a % b, y, x), y -= a / b * x) : (x = 1, y = 0);
}
inline long long gcd(long long a, long long b) {
  return (b ? gcd(b, a % b) : a);
}
inline long long inv(long long a, long long b) {
  ext_gcd(a, b, x, y);
  return (x % b + b) % b;
}
int n, m;
bool exist[MAXN];
inline void read_in() {
  R(n), R(m);
  for (int i = 1; i < m; ++i) s[gcd(i, m)].insert(i);
  for (int i = 1; i <= n; ++i) R(x), s[gcd(x, m)].erase(x), exist[x] = true;
}
inline void solve() {
  for (std::set<long long>::iterator it = s[1].begin(); it != s[1].end(); ++it)
    ori_num.push_back(*it);
  for (int i = m - 1; i >= 2; --i) {
    max_size[i] = s[i].size();
    for (int j = 2 * i; j < m; j += i)
      if (max_size[j] + s[i].size() > max_size[i])
        max_size[i] = max_size[j] + s[i].size(), next_num[i] = j;
  }
  int id = 0;
  for (int i = 2; i < m; ++i)
    if (id == 0 || max_size[i] > max_size[id]) id = i;
  for (; id; id = next_num[id])
    for (std::set<long long>::iterator it = s[id].begin(); it != s[id].end();
         ++it)
      ori_num.push_back(*it);
  if (ori_num.size()) new_num.push_back(ori_num[0]);
  for (int i = 1; i < ori_num.size(); ++i) {
    long long x = ori_num[i - 1], y = ori_num[i], temp = m;
    long long t = gcd(x, temp);
    x /= t, y /= t, temp /= t;
    new_num.push_back(y * inv(x, temp) % temp);
  }
  if (!exist[0]) new_num.push_back(0);
  W(new_num.size()), write_char('\n');
  for (int i = 0; i < new_num.size(); ++i) W(new_num[i]), write_char(' ');
}
int main() {
  read_in();
  solve();
  flush();
  return 0;
}
