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;
template <typename T>
T sqr(T x) {
  return x * x;
}
template <typename T>
T abs(T x) {
  return x > 0 ? x : -x;
}
int gcd(int x, int y) {
  while (x > 0 && y > 0) {
    if (x > y) {
      x %= y;
    } else {
      y %= x;
    }
  }
  return x + y;
}
const int maxn = 2e5 + 3;
bool used[maxn];
vector<int> g[maxn];
int dp[maxn];
int cnt[maxn];
bool bad[maxn];
int nods[maxn];
void dfs(int v) {
  used[v] = true;
  if (g[v].empty()) {
    dp[v] = cnt[v];
    return;
  }
  dp[v] = 0;
  for (auto to : g[v]) {
    if (!used[to]) {
      dfs(to);
    }
    dp[v] = max(dp[v], dp[to]);
  }
  dp[v] += cnt[v];
}
long long binpow(long long x, long long st, long long mod) {
  long long ans = 1;
  while (st) {
    if (st & 1) {
      ans = (ans * x) % mod;
    }
    x = (x * x) % mod;
    st >>= 1;
  }
  return ans;
}
int main() {
  int n, m;
  cin >> n >> m;
  int _m = m;
  int phi = m;
  for (int i = 2; i <= _m; i++) {
    if (_m % i == 0) {
      phi /= i;
      phi *= i - 1;
      while (_m % i == 0) {
        _m /= i;
      }
    }
  }
  if (_m > 1) {
    phi /= _m;
    phi *= _m - 1;
  }
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    bad[x] = true;
  }
  for (int i = 1; i <= m; i++) {
    nods[i] = gcd(i, m);
  }
  vector<int> ver;
  for (int i = 1; i < m; i++) {
    if (m % i == 0) {
      ver.push_back(i);
      for (int j = 1; j < m / i; j++) {
        if (nods[j * i] == i) {
          if (!bad[j * i]) {
            cnt[i]++;
          }
        }
      }
    }
  }
  ver.push_back(m);
  if (!bad[0]) {
    cnt[m]++;
  }
  for (int i = 0; i < (int)ver.size(); i++) {
    for (int j = i + 1; j < (int)ver.size(); j++) {
      if (ver[j] % ver[i] == 0) {
        g[ver[i]].push_back(ver[j]);
      }
    }
  }
  dfs(1);
  int cur = 1;
  vector<int> ans;
  while (cur < m) {
    for (int j = cur; j < m; j += cur) {
      if (nods[j] == cur) {
        if (!bad[j]) {
          ans.push_back(j);
        }
      }
    }
    for (auto to : g[cur]) {
      if (dp[to] == dp[cur] - cnt[cur]) {
        cur = to;
        break;
      }
    }
  }
  if (!bad[0]) {
    ans.push_back(0);
  }
  vector<int> aans = ans;
  for (int i = 1; i < (int)ans.size(); i++) {
    if (ans[i] == 0) {
      continue;
    }
    int nod = gcd(ans[i], ans[i - 1]);
    if (nods[ans[i] / nod] == 1) {
      long long x =
          ans[i] / nod * 1ll * binpow(ans[i - 1] / nod, phi - 1, m) % m;
      aans[i] = x;
    } else {
      int cur = 0;
      for (int j = 1; j < m; j++) {
        cur = (cur + ans[i - 1]) % m;
        if (cur == ans[i]) {
          aans[i] = j;
          break;
        }
      }
    }
    assert(ans[i - 1] * 1ll * aans[i] % m == ans[i]);
  }
  cout << aans.size() << "\n";
  for (auto x : aans) {
    cout << x << " ";
  }
  cout << "\n";
  return 0;
}
