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>
template <class t>
inline void read(t &s) {
  s = 0;
  register long long f = 1;
  register char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) s = (s << 3) + (s << 1) + (c ^ 48), c = getchar();
  s *= f;
  return;
}
template <class t, class... A>
inline void read(t &x, A &...a) {
  read(x);
  read(a...);
}
template <class t>
inline void write(t x) {
  if (x < 0) putchar('-'), x = -x;
  long long buf[21], top = 0;
  while (x) buf[++top] = x % 10, x /= 10;
  if (!top) buf[++top] = 0;
  while (top) putchar(buf[top--] ^ '0');
  return;
}
inline void setIn(std::string s) {
  freopen(s.c_str(), "r", stdin);
  return;
}
inline void setOut(std::string s) {
  freopen(s.c_str(), "w", stdout);
  return;
}
inline void setIO(std::string s = "") {
  setIn(s + ".in");
  setOut(s + ".out");
  return;
}
template <class t>
inline bool checkmin(t &x, t y) {
  if (x > y) {
    x = y;
    return 1;
  }
  return 0;
}
template <class t>
inline bool checkmax(t &x, t y) {
  if (x < y) {
    x = y;
    return 1;
  }
  return 0;
}
inline long long lowbit(long long x) { return x & (-x); }
const long long MaxN = 2e5 + 50;
long long m, n;
long long f[MaxN], pre[MaxN], dead[MaxN];
std::vector<long long> scc[MaxN];
inline long long gcd(long long a, long long b) {
  return !b ? a : gcd(b, a % b);
}
inline void exgcd(long long a, long long b, long long &x, long long &y) {
  return !b ? (x = 1, y = 0, void())
            : (exgcd(b, a % b, y, x), y -= a / b * x, void());
}
inline long long inv(long long a, long long b) {
  long long x, y, g = gcd(a, n);
  exgcd(a / g, n / g, x, y);
  return (x * b / g % n + n) % n;
}
signed main(void) {
  read(m, n);
  register long long x;
  for (long long i = 1; i <= m; ++i) read(x), dead[x] = 1;
  if (!dead[0]) scc[0].push_back(0), f[0] = 1;
  for (long long i = 1; i < n; ++i)
    if (!dead[i]) scc[gcd(i, n)].push_back(i);
  for (long long u = 1; u < n; ++u)
    if (!(n % u)) {
      f[u] += (long long)scc[u].size();
      for (long long v = u + u; v < n; v += u)
        if (!(n % v))
          if (checkmax(f[v], f[u])) pre[v] = u;
    }
  register long long pos = 0;
  for (long long i = 1; i < n; ++i)
    if (f[i] > f[pos]) pos = i;
  std::vector<long long> ans;
  if (f[0]) ans.push_back(0);
  for (; pos; pos = pre[pos])
    for (auto i : scc[pos]) ans.push_back(i);
  std::reverse((ans).begin(), (ans).end());
  write((long long)ans.size()), std::puts("");
  if ((long long)ans.size()) write(ans[0]), std::putchar(32);
  for (long long i = 1; i < (long long)ans.size(); ++i)
    write(inv(ans[i - 1], ans[i])), std::putchar(32);
  std::puts("");
  return 0;
}
