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 MAXM = 200000 + 10;
int N, M;
bool forbidden[MAXM];
int f[MAXM], g[MAXM];
vector<int> divi[MAXM];
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long ext_gcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1, y = 0;
    return a;
  } else {
    int d = ext_gcd(b, a % b, x, y);
    int t = x;
    x = y;
    y = t - a / b * y;
    return d;
  }
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= N; ++i) {
    int x;
    scanf("%d", &x);
    forbidden[x] = 1;
  }
  for (int i = 1; i < M; ++i)
    if (forbidden[i] == false) divi[gcd(i, M)].push_back(i);
  if (forbidden[0] == false) divi[M].push_back(0);
  fill_n(f, M + 1, 0);
  fill_n(g, M + 1, -1);
  for (int d = 1; d <= M; ++d) {
    int target = -1;
    int targetValue = 0;
    for (int di_index = 0; di_index < divi[d].size(); ++di_index) {
      int now = divi[d][di_index];
      if (f[now] + divi[d].size() > targetValue) {
        targetValue = f[now] + divi[d].size();
        target = now;
      }
    }
    for (int mul = 0; mul * d < M; ++mul) {
      int nex = d * mul;
      if (forbidden[nex]) continue;
      if (gcd(nex, M) == d) continue;
      if (targetValue > f[nex]) {
        f[nex] = max(f[nex], targetValue);
        g[nex] = target;
      }
    }
  }
  int target = -1;
  int targetValue = 0;
  for (int last = 0; last < M; ++last) {
    if (forbidden[last]) continue;
    int d = gcd(last, M);
    if (d == 0) d = M;
    if (f[last] + divi[d].size() > targetValue) {
      targetValue = f[last] + divi[d].size();
      target = last;
    }
  }
  vector<int> headList;
  for (int now = target; now != -1; now = g[now]) {
    headList.push_back(now);
  }
  vector<int> candidateList;
  for (int index = 0; index < headList.size(); ++index) {
    int forbidden = headList[index];
    int d = gcd(forbidden, M);
    if (d == 0) d = M;
    for (int i = 0; i < divi[d].size(); ++i)
      if (divi[d][i] != forbidden) candidateList.push_back(divi[d][i]);
    candidateList.push_back(forbidden);
  }
  vector<int> ansList;
  for (int i = 0; i < candidateList.size() - 1; ++i) {
    int now = candidateList[i + 1];
    int nex = candidateList[i];
    if (nex == 0) nex = M;
    long long a = now, b = nex, c = M;
    long long d = gcd(a, c);
    a /= d;
    b /= d;
    c /= d;
    long long x, y;
    ext_gcd(a, c, x, y);
    x = (((x % c) + c) % c * b) % c;
    ansList.push_back(x);
  }
  ansList.push_back(*(candidateList.end() - 1));
  reverse(ansList.begin(), ansList.end());
  cout << ansList.size() << endl;
  for (int i = 0; i < ansList.size(); ++i)
    if (i < ansList.size() - 1)
      cout << ansList[i] << " ";
    else
      cout << ansList[i] << endl;
  return 0;
}
