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 comment(linker, "/STACK:256000000")
using namespace std;
const int INF = 1000 * 1000 * 1000 + 21;
const long long int LLINF = (1ll << 60) + 5;
const int MOD = 1000 * 1000 * 1000 + 7;
const int MAX_N = 200 * 1000 + 5;
long long int gcd(long long int a, long long int b, long long int &x,
                  long long int &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long int x1, y1;
  long long int d = gcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
long long int fast_gcd(long long int a, long long int b) {
  return b ? fast_gcd(b, a % b) : a;
}
int n;
long long int m;
bool used[MAX_N];
long long int cnt[MAX_N];
vector<long long int> div228;
long long int dp[MAX_N];
int last[MAX_N];
vector<long long int> ans;
vector<long long int> mem[MAX_N];
vector<long long int> true_ans;
int main() {
  scanf("%d%lld", &n, &m);
  long long int x;
  for (int i = 0; i < n; ++i) {
    scanf("%lld", &x);
    used[x] = true;
  }
  for (long long int i = 1; i * i <= m; ++i) {
    if (m % i == 0) {
      div228.push_back(i);
      if (m / i != i) div228.push_back(m / i);
    }
  }
  sort(div228.begin(), div228.end());
  for (int i = 0; i < m; ++i) {
    if (!used[i]) {
      ++cnt[fast_gcd(i, m)];
      mem[fast_gcd(i, m)].push_back(i);
    }
  }
  for (int i = 0; i < (int)div228.size(); ++i) {
    dp[i] = cnt[div228[i]];
    last[i] = -1;
    for (int j = i - 1; j >= 0; --j) {
      if (div228[i] % div228[j] == 0) {
        if (dp[j] + cnt[div228[i]] > dp[i]) {
          dp[i] = dp[j] + cnt[div228[i]];
          last[i] = j;
        }
      }
    }
  }
  int ptr = 0;
  for (int i = 0; i < (int)div228.size(); ++i) {
    if (dp[ptr] < dp[i]) {
      ptr = i;
    }
  }
  for (; ptr != -1; ptr = last[ptr]) {
    for (int j = 0; j < (int)mem[div228[ptr]].size(); ++j)
      ans.push_back(mem[div228[ptr]][j]);
  }
  long long int y;
  for (int i = (int)ans.size() - 1; i >= 0; --i) {
    long long int last = 1;
    if (i != (int)ans.size() - 1) last = ans[i + 1];
    gcd(last, m, x, y);
    long long int next = (x * ans[i]) / fast_gcd(m, last) % m;
    if (next < 0) next += m;
    true_ans.push_back(next);
  }
  printf("%d\n", (int)true_ans.size());
  for (int i = 0; i < (int)true_ans.size(); ++i) {
    printf("%lld ", true_ans[i]);
  }
  printf("\n");
  return 0;
}
