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 MAXN = 200005;
vector<int> C[MAXN];
pair<int, int> dp[MAXN];
bool taken[MAXN];
vector<int> divisors;
int phi[MAXN];
int gcd(int a, int b) {
  if (a < b) swap(a, b);
  while (b > 0) {
    a %= b;
    swap(a, b);
  }
  return a;
}
int pow(long long a, long long b, long long M) {
  if (b == 0) return 1;
  long long x;
  x = pow(a, b / 2, M);
  x = (x * x) % M;
  if (b % 2 == 1) x = (x * a) % M;
  return x;
}
int inv(int x, int M) {
  assert(gcd(x, M) == 1);
  return pow(x, phi[M] - 1, M);
}
int div(int a, int b, long long M) {
  int g = gcd(b, M);
  assert(a % g == 0);
  a /= g;
  b /= g;
  long long x = (long long)a * (long long)inv(b, M / g);
  return (int)(x % M);
}
int smallPrime[MAXN];
void CalcPhi(int M) {
  for (int d = 2; d <= M; d++) {
    if (smallPrime[d] != 0) continue;
    int pnt = d;
    while (pnt <= M) {
      if (smallPrime[pnt] == 0) smallPrime[pnt] = d;
      pnt += d;
    }
  }
  phi[1] = 1;
  for (int x = 2; x <= M; x++) {
    if (smallPrime[x] == x)
      phi[x] = x - 1;
    else {
      int p = smallPrime[x];
      int q = 1;
      int y = x;
      while (y % p == 0) {
        q *= p;
        y /= p;
      }
      phi[x] = phi[y] * (q - (q / p));
    }
  }
}
int ansM[MAXN];
int main() {
  int N, M;
  cin >> N >> M;
  CalcPhi(M);
  for (int i = 1; i <= N; i++) {
    int x;
    cin >> x;
    if (x == 0) x = M;
    taken[x] = true;
  }
  for (int i = 1; i <= M; i++) {
    if (!taken[i]) C[gcd(i, M)].push_back(i);
  }
  int ansLast = 0;
  dp[0] = make_pair(-1, -1);
  for (int d = 1; d <= M; d++) {
    if (M % d != 0) continue;
    if (d == 1) {
      dp[1] = make_pair(C[1].size(), 0);
    } else {
      int MaxU = 0;
      for (int pnt = 0; pnt < divisors.size(); pnt++) {
        int u = divisors[pnt];
        if (d % u == 0 && dp[u].first > dp[MaxU].first) {
          MaxU = u;
        }
      }
      dp[d] = make_pair((int)C[d].size() + dp[MaxU].first, MaxU);
    }
    if (dp[ansLast].first < dp[d].first) {
      ansLast = d;
    }
    divisors.push_back(d);
  }
  int A = dp[ansLast].first;
  int CA = A;
  cout << A << endl;
  while (dp[ansLast].first != -1) {
    for (int i = 0; i < C[ansLast].size(); i++) {
      ansM[A] = C[ansLast][i];
      A--;
    }
    ansLast = dp[ansLast].second;
  }
  cout << ansM[1] % M << " ";
  for (int i = 2; i <= CA; i++) {
    cout << div(ansM[i], ansM[i - 1], M) % M << " ";
  }
  return 0;
}
