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;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
map<int, vector<int> > ma;
int phi(int a) {
  int ans = a;
  for (int i = 2; i * i <= a; i++) {
    if (a % i == 0) {
      ans = (ans / i) * (i - 1);
      while (a % i == 0) {
        a /= i;
      }
    }
  }
  if (a != 1) {
    ans = (ans / a) * (a - 1);
  }
  return ans;
}
long long my_pow(int a, int b, int modd) {
  if (b == 0) return 1 % modd;
  long long tmp = my_pow(a, b / 2, modd);
  long long ret = (tmp * tmp) % modd;
  if (b & 1) {
    ret = (ret * a) % modd;
  }
  return ret;
}
int mod_inv(int a, int modd) {
  int b = phi(modd) - 1;
  return my_pow(a, b, modd);
}
int primitive(int a, int b, int modd) {
  long long ret = mod_inv(a, modd);
  ret *= 1LL * b;
  ret %= modd;
  return ret;
}
int n, m;
int needed(int a, int b) {
  int g = gcd(a, m);
  return primitive(a / g, b / g, m / g);
}
int main() {
  scanf("%d %d", &n, &m);
  vector<bool> forbidden(m + 5, false);
  for (int i = 0; i < n; i++) {
    int foo;
    scanf("%d", &foo);
    forbidden[foo] = true;
  }
  for (int i = 1; i < m; i++) {
    if (forbidden[i]) continue;
    int g = gcd(i, m);
    ma[g].push_back(i);
  }
  vector<int> out_degree(m + 5, 0);
  vector<vector<int> > reverse_edges(m + 5);
  vector<vector<int> > forward_edges(m + 5);
  vector<int> best(m + 5, -1);
  vector<int> go_to(m + 5, -1);
  for (auto it1 = ma.begin(); it1 != ma.end(); it1++) {
    for (auto it2 = ma.begin(); it2 != ma.end(); it2++) {
      int x = it1->first;
      int y = it2->first;
      if (x == y) continue;
      if (x % y == 0) {
        out_degree[y]++;
        reverse_edges[x].push_back(y);
        forward_edges[y].push_back(x);
      }
    }
  }
  vector<int> weight(m + 5, -1);
  for (int i = 1; i < m; i++) {
    if (ma.count(i) > 0) {
      weight[i] = ma[i].size();
    }
  }
  queue<int> q;
  for (int i = 1; i < m; i++) {
    if (weight[i] == -1) continue;
    if (out_degree[i] != 0) continue;
    best[i] = weight[i];
    q.push(i);
  }
  while (!q.empty()) {
    int now = q.front();
    q.pop();
    pair<int, int> pa = make_pair(0, -1);
    for (int i = 0; i < forward_edges[now].size(); i++) {
      int neigh = forward_edges[now][i];
      pa = max(pa, make_pair(best[neigh], neigh));
    }
    best[now] = pa.first + weight[now];
    go_to[now] = pa.second;
    for (int coming_from : reverse_edges[now]) {
      out_degree[coming_from]--;
      if (out_degree[coming_from] == 0) {
        q.push(coming_from);
      }
    }
  }
  pair<int, int> to_max = make_pair(0, -1);
  for (int i = 1; i < m; i++) {
    if (best[i] == -1) continue;
    to_max = max(to_max, make_pair(best[i], i));
  }
  vector<int> path;
  int now = to_max.second;
  while (now != -1) {
    path.push_back(now);
    now = go_to[now];
  }
  vector<int> ans;
  int last = 1;
  for (int node : path) {
    for (int dest : ma[node]) {
      ans.push_back(needed(last, dest));
      last = dest;
    }
  }
  if (!forbidden[0]) {
    ans.push_back(0);
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) {
    if (i != 0) {
      printf(" ");
    }
    printf("%d", ans[i]);
  }
  printf("\n");
  return 0;
}
