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>
#pragma GCC optimize("O3")
using namespace std;
using LL = long long;
using vi = vector<int>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
using vll = vector<LL>;
using LD = long double;
template <typename T>
T gcd(T a, T b) {
  return (a ? gcd(b % a, a) : b);
}
template <typename T>
pair<T, T> extend_euclid(T a, T b) {
  pair<T, T> a_one = {1, 0}, b_one = {0, 1};
  if (!b) return a_one;
  while (a) {
    T q = b / a;
    T r = b % a;
    T dx = b_one.first - q * a_one.first;
    T dy = b_one.second - q * a_one.second;
    b = a;
    a = r;
    b_one = a_one;
    a_one = {dx, dy};
  }
  return b_one;
}
const int N = 2e5 + 10;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cerr.tie(NULL);
  ;
  int n, m;
  cin >> n >> m;
  vi f(m + 1, 0);
  vector<pair<int, int>> x;
  vector<vi> g(m);
  vector<int> dp(m + 1, 0);
  vector<int> Move(m + 1, -1);
  vector<int> pre(m + 1, -1);
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    f[a] = 1;
  }
  for (int i = 0; i < m; i++) {
    if (!f[i]) {
      x.push_back({gcd(i, m), i});
    }
  }
  sort(x.begin(), x.end());
  n = (int)x.size();
  dp[n - 1] = 1;
  pre[x[n - 1].first] = n - 1;
  int place = n - 1;
  for (int i = n - 2; i >= 0; i--) {
    if (x[i].first == x[i + 1].first) {
      dp[i] = dp[i + 1] + 1;
      pre[x[i].first] = i;
      Move[i] = i + 1;
    } else {
      int a = x[i].first;
      pre[a] = i;
      dp[i] = 1;
      for (int j = a + a; j < m; j += a) {
        if (pre[j] != -1) {
          int idx = pre[j];
          if (dp[i] < dp[idx] + 1) {
            dp[i] = dp[idx] + 1;
            Move[i] = idx;
          }
        }
      }
    }
    if (dp[i] > dp[place]) {
      place = i;
    }
  }
  vi ans = {x[place].second};
  int pro = x[place].second;
  for (int i = Move[place], last = place; i != -1; last = i, i = Move[i]) {
    int a1 = pro / x[last].first, m1 = m / x[last].first;
    int xx = extend_euclid(a1, m1).first;
    xx = (xx + m) % m;
    LL b = (xx * 1LL * x[i].second) / x[last].first;
    b %= m;
    pro = (pro * 1LL * b) % m;
    ans.push_back(b);
  }
  if (!f[0] && ans.back() != 0) ans.push_back(0);
  cout << ans.size() << '\n';
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i] << " \n"[i + 1 == ans.size()];
  pro = 1;
  return 0;
}
