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;
long long read() {
  char c = getchar();
  long long u = 0, f = 1;
  while (c != '-' && (c < '0' || '9' < c)) c = getchar();
  if (c == '-') {
    f = -1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    u = u * 10 + c - '0';
    c = getchar();
  }
  return u * f;
}
char readc() {
  for (;;) {
    char c = getchar();
    if ('A' <= c && c <= 'Z' || 'a' <= c && c <= 'z') return c;
  }
}
int read_digit() {
  for (;;) {
    char c = getchar();
    if ('0' <= c && c <= '9') return c - '0';
  }
}
inline int max(int a, int b) { return a > b ? a : b; }
inline int min(int a, int b) { return a < b ? a : b; }
template <typename T>
inline void updmax(T &a, T b) {
  if (b > a) a = b;
}
template <typename T>
inline void updmin(T &a, T b) {
  if (b < a) a = b;
}
inline void swap(int &a, int &b) {
  int t = a;
  a = b;
  b = t;
}
inline void fileio(string s) {
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
struct graph {
  struct node {
    int k, next;
  } G[10000010];
  int head[200010], cnt;
  graph(void) { cnt = 0; }
  inline void ins(int a, int b) {
    G[++cnt].k = b;
    G[cnt].next = head[a];
    head[a] = cnt;
  }
  node operator[](int k) { return G[k]; }
} G1, G2;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
vector<int> rec[200010], ans;
int g[200010];
bool forbid[200010];
int dp[200010], pre[200010], n, m;
long long exgcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1, y = 0;
    return a;
  }
  int q = exgcd(b, a % b, y, x);
  y -= a / b * x;
  return q;
}
int solve(int a, int b, int c) {
  int u = gcd(a, b);
  a /= u;
  b /= u;
  c /= u;
  long long x, y;
  exgcd(a, b, x, y);
  x = (x * c) % b;
  while (x < 0) x += b;
  return x;
}
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= n; i++) {
    int u = read();
    forbid[u] = 1;
  }
  for (int i = 1; i <= m; i++) {
    if (forbid[i]) continue;
    g[i] = gcd(i, m);
    rec[g[i]].push_back(i);
  }
  for (int i = 1; i <= m; i++) {
    for (int j = i + i; j <= m; j += i) {
      if (dp[j] < dp[i] + rec[i].size()) {
        dp[j] = dp[i] + rec[i].size();
        pre[j] = i;
      }
    }
  }
  for (int i = m; i; i = pre[i]) {
    for (int j = 0; j < rec[i].size(); j++) ans.push_back(rec[i][j]);
  }
  reverse(ans.begin(), ans.end());
  if (forbid[0]) ans.pop_back();
  printf("%d\n", ans.size());
  int now = 1;
  for (int i = 0; i < ans.size(); i++) {
    int u = solve(now, m, ans[i]);
    printf("%d ", u);
    assert(u != 1);
    now = (long long)now * u % m;
  }
  return 0;
}
