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;
template <typename T, typename S>
inline ostream& operator<<(ostream& os, const pair<T, S> p) {
  cout << "[" << p.first << ";" << p.second << "]";
  return os;
}
template <typename T>
inline ostream& operator<<(ostream& os, const vector<T>& v) {
  for (auto el : v) cout << el << " ";
  return os;
}
namespace debug {
struct DebugStream {
 private:
  bool is_first;

 public:
  DebugStream(bool _is_first) : is_first(_is_first) {}
  template <typename T>
  DebugStream operator<<(const T& value) const {
    if (0) {
      if (is_first) cout << "[DBG] ";
      cout << value;
    }
    return DebugStream(false);
  };
};
DebugStream instance(true);
};  // namespace debug
using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INT_INF = (int)(2e9);
const ll LL_INF = (ll)(2e18);
const int NIL = -1;
static mt19937 _g(time(nullptr));
inline ll randint(ll a, ll b) {
  ll w = (_g() << 31LL) ^ _g();
  return a + w % (b - a + 1);
}
inline void fast_io() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
};
template <typename T>
inline T sign(T x) {
  return T(x > 0) - T(x < 0);
}
template <typename T>
inline T fetch() {
  T ret;
  cin >> ret;
  return ret;
}
template <typename T>
inline vector<T> fetch_vec(int sz) {
  vector<T> ret(sz);
  for (auto& elem : ret) cin >> elem;
  return ret;
}
ll GCD(ll x, ll y) { return x == 0 ? y : GCD(y % x, x); }
pll extGCD(ll a, ll b) {
  if (a == 0 || b == 0) {
    return make_pair(1, 1);
  }
  if (a < 0) {
    auto soln = extGCD(-a, b);
    soln.first = -soln.first;
    return soln;
  }
  if (b < 0) {
    auto soln = extGCD(a, -b);
    soln.second = -soln.second;
    return soln;
  }
  if (a < b) {
    auto soln = extGCD(b, a);
    swap(soln.first, soln.second);
    return soln;
  }
  auto soln = extGCD(a % b, b);
  return make_pair(soln.first, -soln.first * (a / b) + soln.second);
}
pll solveEq(ll a, ll b, ll c) {
  ll g = GCD(a, b);
  assert(c % g == 0);
  pll soln = extGCD(a, b);
  soln.first *= c / g;
  soln.second *= c / g;
  return soln;
}
const int MAXN = (int)2e5 + 7;
vector<int> byGCD[MAXN];
int banned[MAXN];
int n, MOD;
int used[MAXN], dp[MAXN], go[MAXN];
int divide(int a, int b) {
  auto soln = solveEq(b, MOD, a);
  ll rez = soln.first;
  rez %= MOD;
  rez += MOD;
  rez %= MOD;
  return rez;
}
void dfsik(int v) {
  used[v] = 1;
  go[v] = NIL;
  if (byGCD[v].empty()) return;
  dp[v] = ((int)(byGCD[v]).size());
  int change = 0;
  if (v > 0)
    for (int u = 2 * v; u < MOD; u += v) {
      if (!used[u]) dfsik(u);
      if (dp[u] > change) {
        change = dp[u];
        go[v] = u;
      }
    }
  if (!used[0]) dfsik(0);
  if (dp[0] > change && v != 0) {
    change = dp[0];
    go[v] = 0;
  }
  dp[v] += change;
}
int answ[MAXN], answSz = 0;
void solve() {
  cin >> n >> MOD;
  for (int i = 0; i < n; ++i) {
    int x = fetch<int>();
    banned[x] = 1;
  }
  for (int i = 0; i < MOD; ++i)
    if (!banned[i]) {
      int g = GCD(i, MOD) % MOD;
      byGCD[g].push_back(i);
    }
  int start = 0;
  for (int i = 0; i < MOD; ++i) {
    if (!used[i]) dfsik(i);
    if (dp[i] > dp[start]) start = i;
  }
  for (int cur = start; cur != NIL; cur = go[cur]) {
    for (auto& el : byGCD[cur]) answ[answSz++] = el;
  }
  for (int i = answSz - 1; i > 0; --i) answ[i] = divide(answ[i], answ[i - 1]);
  cout << answSz << '\n';
  for (int i = 0; i < answSz; ++i) cout << answ[i] << ' ';
  cout << '\n';
}
int main() {
  fast_io();
  solve();
  return 0;
}
