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;
const int sz = 2e6 + 10;
bool disable[sz];
bool passed[sz];
long long int gcd(long long int a, long long int b) {
  if (a % b == 0) {
    return b;
  }
  return gcd(b, a % b);
}
pair<long long int, long long int> egcd(long long int a, long long int b) {
  if (a % b == 0) {
    return make_pair(0, 1);
  }
  pair<long long int, long long int> pa = egcd(b, a % b);
  return make_pair(pa.second, pa.first - (a / b) * pa.second);
}
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    disable[x] = true;
  }
  vector<vector<int>> gcds(m);
  for (int i = 1; i < m; ++i) {
    if (disable[i]) {
      continue;
    }
    int g = gcd(i, m);
    gcds[g].push_back(i);
  }
  vector<int> dp(m);
  vector<int> pre(m);
  for (int i = 1; i < m; ++i) {
    dp[i] = gcds[i].size();
    pre[i] = i;
  }
  for (int i = 1; i < m; ++i) {
    for (int j = i + i; j < m; j += i) {
      if (dp[i] + gcds[j].size() > dp[j]) {
        dp[j] = dp[i] + gcds[j].size();
        pre[j] = i;
      }
    }
  }
  auto iter = max_element(dp.begin(), dp.end());
  int idx = iter - dp.begin();
  stack<int> ans;
  auto push = [&ans](int v) { ans.push(v); };
  do {
    for_each(gcds[idx].begin(), gcds[idx].end(), push);
    if (idx == pre[idx]) {
      break;
    }
    idx = pre[idx];
  } while (true);
  int M = *max_element(dp.begin(), dp.end());
  if (!disable[0]) {
    ++M;
  }
  cout << M << endl;
  if (ans.size() == 0) {
    cout << 0 << endl;
    return 0;
  }
  int from = ans.top();
  cout << from << " ";
  ans.pop();
  while (!ans.empty()) {
    int to = ans.top();
    ans.pop();
    pair<long long int, long long int> eg = egcd(from, m);
    long long int x = (eg.first * (to / gcd(from, m))) % m;
    x = x < 0 ? x + m : x;
    cout << x << " ";
    from = to;
  }
  if (!disable[0]) {
    cout << 0 << endl;
  }
}
