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 long long maxn = 2e5 + 5;
long long mod;
vector<long long> numbers[maxn];
vector<long long> children[maxn];
char forbid[maxn];
long long dp[maxn];
long long parent[maxn];
long long gcd(long long a, long long b) {
  while (a && b) {
    if (a >= b)
      a %= b;
    else
      b %= a;
  }
  return a + b;
}
long long power(long long x, long long p) {
  if (p == 0) return 1 % mod;
  if (p & 1) return x * power(x, p - 1) % mod;
  return power(x * x % mod, p >> 1);
}
long long gcd(long long a, long long b, long long &x, long long &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long x1, y1;
  long long d = gcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
long long step(long long prev, long long cur) {
  long long x, y;
  long long g = gcd(prev, mod, x, y);
  return (x * (cur / g) % mod + mod) % mod;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long num;
  cin >> num >> mod;
  for (long long i = 0; i < num; ++i) {
    long long x;
    cin >> x;
    if (x == 0) x += mod;
    forbid[x] = true;
  }
  for (long long i = 1; i <= mod; ++i) {
    if (!forbid[i]) {
      numbers[gcd(i, mod)].push_back(i % mod);
    }
  }
  for (long long i = 1; i <= mod; ++i) {
    if (mod % i != 0) continue;
    for (long long j = i + i; j <= mod; j += i) {
      if (mod % j != 0) continue;
      children[i].push_back(j);
    }
  }
  for (long long i = mod; i >= 1; --i) {
    if (gcd(i, mod) != i) continue;
    long long maxval = 0;
    parent[i] = -1;
    for (auto d : children[i]) {
      if (dp[d] > maxval) {
        maxval = dp[d];
        parent[i] = d;
      }
    }
    dp[i] = maxval + (long long)numbers[i].size();
  }
  long long current = 1;
  vector<long long> muls;
  while (current != -1) {
    for (auto i : numbers[current]) {
      muls.push_back(i);
    }
    current = parent[current];
  }
  for (long long i = 1; i <= mod; ++i) {
    if (forbid[i]) {
      numbers[gcd(i, mod)].push_back(i % mod);
    }
  }
  cout << muls.size() << '\n';
  for (long long i = 0; i < muls.size(); ++i) {
    if (i == 0) {
      cout << muls[i] << ' ';
    } else {
      long long tmp = step(muls[i - 1], muls[i]);
      cout << tmp << ' ';
    }
  }
}
