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 inf = 0x3f3f3f3f;
const int maxn = 200010;
int n, m;
int pre[maxn], dp[maxn], ans[maxn];
bool leap[maxn];
vector<int> vt[maxn], G[maxn], ansq;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int exgcd(int a, int b, long long &x, long long &y) {
  if (!b) {
    x = 1, y = 0;
    return a;
  }
  int t, ret;
  ret = exgcd(b, a % b, x, y);
  t = x, x = y, y = t - a / b * y;
  return ret;
}
long long work(int a, int b) {
  long long x, y;
  long long r = exgcd(a, m, x, y);
  long long k = b / r;
  x = x * k;
  x = (x % m + m) % m;
  return x;
}
void prin(int id) {
  if (pre[id] == -1) {
    printf("%d", vt[id][0]);
    for (int i = 0; i < vt[id].size() - 1; i++) {
      printf(" %d", work(vt[id][i], vt[id][i + 1]));
    }
    return;
  }
  prin(pre[id]);
  int las = vt[pre[id]].size() - 1;
  las = vt[pre[id]][las];
  printf(" %d", work(las, vt[id][0]));
  for (int i = 0; i < vt[id].size() - 1; i++) {
    printf(" %d", work(vt[id][i], vt[id][i + 1]));
  }
}
int dfs(int x) {
  if (ans[x] != -1) return ans[x];
  ans[x] = 0;
  for (int i = 0; i < G[x].size(); i++) {
    int v = G[x][i];
    int temp = dfs(v);
    if (temp > ans[x]) {
      ans[x] = temp;
      pre[x] = v;
    }
  }
  ans[x] += dp[x];
  return ans[x];
}
void check(int x) {
  if (pre[x] == -1) {
    cout << "x"
         << " = " << x << " " << endl;
    ;
    for (int i = 0; i < vt[x].size(); i++)
      cout << "vt[x][i]"
           << " = " << vt[x][i] << " ";
    ;
    cout << endl;
    return;
  }
  check(pre[x]);
  for (int i = 0; i < vt[x].size(); i++)
    cout << "vt[x][i]"
         << " = " << vt[x][i] << " ";
  ;
  cout << endl;
  return;
}
int main() {
  scanf("%d%d", &n, &m);
  memset(leap, false, sizeof(leap));
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    leap[x] = true;
  }
  memset(pre, -1, sizeof(pre));
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i < m; i++) {
    if (leap[i]) continue;
    int temp = gcd(i, m);
    dp[temp]++;
    vt[temp].push_back(i);
  }
  vt[0].push_back(0);
  for (int i = 1; i < m; i++) {
    if (m % i) continue;
    if (!leap[0]) G[0].push_back(i);
    for (int j = i; j < m; j += i) {
      if (i == j) continue;
      if (m % j) continue;
      G[j].push_back(i);
    }
  }
  if (!leap[0]) dp[0]++;
  memset(ans, -1, sizeof(ans));
  for (int i = 0; i < m; i++) {
    if (ans[i] == -1) ans[i] = dfs(i);
  }
  int rans = 0, ransid = -1;
  for (int i = 0; i < m; i++) {
    if (ans[i] > rans) {
      rans = ans[i];
      ransid = i;
    }
  }
  printf("%d\n", rans);
  prin(ransid);
  return 0;
}
