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, mod = 1000000007;
const double pi = 3.1415926535897932, eps = 1e-6;
int n, m, a[200005], siz[200005], cnt, f[200005], fa[200005], ans, p;
bool g[200005], vis[200005];
vector<pair<int, int> > v[200005];
vector<int> ord, an, gx[200005];
int gcd(int x, int y) { return y == 0 ? x : gcd(y, x % y); }
void dfs(int x) {
  vis[x] = 1;
  for (int(i) = (0); (i) < (v[x].size()); (i)++)
    if (!vis[v[x][i].first]) dfs(v[x][i].first);
  ord.push_back(x);
}
void dp() {
  dfs(1);
  reverse(ord.begin(), ord.end());
  for (int(i) = (0); (i) < (m); (i)++)
    if (i != 1) f[i] = -inf;
  for (int(i) = (0); (i) < (ord.size()); (i)++) {
    int t = ord[i];
    for (int(j) = (0); (j) < (v[t].size()); (j)++) {
      int to = v[t][j].first, cost = v[t][j].second;
      if (f[to] < f[t] + cost) f[to] = f[t] + cost, fa[to] = t;
    }
  }
  for (int(i) = (1); (i) < (m); (i)++)
    if (ans < f[i]) ans = f[i], p = i;
}
void exgcd(long long a, long long b, long long &x, long long &y) {
  if (!b) {
    y = 0, x = 1;
    return;
  }
  exgcd(b, a % b, y, x);
  y -= a / b * x;
}
long long solve(long long a, long long b, long long n) {
  long long x = 0, y = 0, d = gcd(a, n);
  exgcd(a, n, x, y);
  long long x0 = x * (b / d) % n + n;
  return x0 % n;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int(i) = (1); (i) <= (n); (i)++) {
    int t;
    scanf("%d", &t);
    g[t] = 1;
  }
  for (int(i) = (1); (i) < (m); (i)++) {
    if (g[i]) continue;
    int t = gcd(i, m);
    gx[t].push_back(i);
    if (!siz[t]) cnt++;
    siz[t]++;
  }
  int num = 0;
  for (int(i) = (1); (i) < (m); (i)++) {
    if (!siz[i]) continue;
    for (int j = 2; j * i <= m; j++) v[i].push_back(make_pair(j * i, siz[i]));
  }
  dp();
  ans += siz[p];
  printf("%d\n", ans + (!g[0]));
  while (p) {
    an.push_back(p);
    p = fa[p];
  }
  long long las = 1, cur = 0;
  for (int(i) = (an.size() - 1); (i) >= (0); (i)--) {
    int now = an[i];
    for (int(j) = (0); (j) < (gx[now].size()); (j)++) {
      cur = gx[now][j];
      printf("%d ", (int)solve(las, cur, m));
      las = cur;
    }
  }
  if (!g[0]) printf("0");
  return 0;
}
