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 long long N = 3e5 + 7;
long long n, m, d[N], cnt[N], a[N];
long long dp[N], p[N];
vector<long long> g[N], b[N], c;
long long gcd(long long a, long long b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
bool used[N];
void dfs(long long v) {
  long long i, to, ok = 0;
  dp[v] = cnt[c[v]];
  p[v] = -1;
  for (i = 0; i < g[v].size(); i++) {
    to = g[v][i];
    if (!used[to]) {
      dfs(to);
    }
    if (dp[v] < dp[to] + cnt[c[v]] || !ok) {
      dp[v] = dp[to] + cnt[c[v]];
      p[v] = to;
      ok = 1;
    }
  }
}
vector<long long> ans;
void getAns(long long v) {
  while (true) {
    for (long long i = 0; i < b[c[v]].size(); i++) ans.push_back(b[c[v]][i]);
    if (p[v] == -1) return;
    v = p[v];
  }
}
long long gcd2(long long a, long long b, long long &x, long long &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long x1, y1;
  long long res = gcd2(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return res;
}
long long f(long long a, long long b) {
  long long g = gcd(a, m);
  a /= g;
  b /= g;
  long long x, y, m1 = m / g;
  gcd2(a, m / g, x, y);
  x = (x + m1 * (abs(x) / m1 + 1)) % m1;
  return (x * b) % m;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  long long i, j;
  cin >> n >> m;
  if (m == 1) {
    if (n == 0)
      cout << 1 << endl << 0;
    else
      cout << 0 << endl;
    return 0;
  }
  for (i = 0; i < n; i++) {
    cin >> a[i];
    d[a[i]] = 1;
  }
  for (i = 0; i < m; i++) {
    if (d[i]) continue;
    long long g = gcd(i, m);
    cnt[g]++;
    b[g].push_back(i);
  }
  long long k = sqrt(m);
  for (i = 1; i <= k; i++) {
    if (m % i == 0) {
      c.push_back(i);
      if (m / i != i) c.push_back(m / i);
    }
  }
  for (i = 0; i < c.size(); i++) {
    for (j = 0; j < c.size(); j++) {
      if (j == i) continue;
      if (c[j] % c[i] == 0) g[i].push_back(j);
    }
  }
  dfs(0);
  getAns(0);
  cout << ans.size() << endl << ans[0] << " ";
  for (i = 1; i < ans.size(); i++) {
    cout << f(ans[i - 1], ans[i]) << " ";
  }
  return 0;
}
