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 N = 200000 + 5;
struct Edge {
  int u, v, w;
  Edge(int u = 0, int v = 0, int w = 0) : u(u), v(v), w(w) {}
};
int n, m;
int vis[N], ru[N], pa[N], dis[N];
vector<int> mul[N];
vector<Edge> G[N];
vector<int> prod;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
void exgcd(int a, int b, int& g, long long& x, long long& y) {
  if (b == 0) {
    g = a;
    x = 1;
    y = 0;
  } else {
    exgcd(b, a % b, g, y, x);
    y -= x * (a / b);
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    int val;
    scanf("%d", &val);
    vis[val] = true;
  }
  for (int i = 1; i < m; i++) {
    if (vis[i]) continue;
    int g = gcd(i, m);
    mul[g].push_back(i);
  }
  for (int i = 1; i < m; i++) {
    if ((int)(mul[i]).size() == 0) continue;
    for (int j = i + i; j < m; j += i) {
      G[i].push_back(Edge(i, j, (int)(mul[j]).size()));
      ++ru[j];
    }
  }
  memset(dis, 0, sizeof(dis));
  queue<int> q;
  for (int i = 1; i < m; i++) {
    if ((int)(mul[i]).size() == 0) continue;
    if (ru[i] > 0) continue;
    dis[i] = (int)(mul[i]).size();
    pa[i] = 0;
    q.push(i);
  }
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (auto e : G[u]) {
      int v = e.v, w = e.w;
      if (dis[u] + w > dis[v]) {
        dis[v] = dis[u] + w;
        pa[v] = u;
      }
      if (--ru[v] == 0) {
        q.push(v);
      }
    }
  }
  int Max = 0, Maxpos = 0;
  for (int i = 1; i < m; i++) {
    if (dis[i] > Max) {
      Max = dis[i];
      Maxpos = i;
    }
  }
  for (int i = Maxpos; i; i = pa[i]) {
    for (auto v : mul[i]) {
      prod.push_back(v);
    }
  }
  reverse((prod).begin(), (prod).end());
  if (!vis[0]) prod.push_back(0);
  printf("%d\n", (int)(prod).size());
  int lst = 1;
  for (auto v : prod) {
    if (v == 0) {
      printf("%d\n", v);
      continue;
    }
    int g;
    long long x, y;
    exgcd(lst, m, g, x, y);
    long long dx = m / g, tp = v / g;
    while (x < 0) x += dx;
    x %= dx;
    x *= tp;
    printf("%lld ", x % m);
    lst = v;
  }
  return 0;
}
