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 double EPS = 1e-10;
const int maxn = 2e5 + 2;
vector<int> where[maxn];
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long pw(long long a, long long pow, int m) {
  int res = 1;
  while (pow) {
    if (pow & 1) res = res * a % m;
    a = a * a % m;
    pow /= 2;
  }
  return res;
}
bool forbid[maxn];
pair<int, int> dp[maxn];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = (0); i < (n); ++i) {
    int x;
    cin >> x;
    forbid[x] = true;
  }
  for (int i = (1); i < (m); ++i) {
    if (!forbid[i]) where[gcd(i, m)].push_back(i);
  }
  for (int i = (1); i < (m); ++i) {
    if (!where[i].empty()) {
      dp[i] = {0, 0};
      for (int j = (1); j < (i); ++j) {
        if ((i % j == 0) && dp[j].first > 0)
          dp[i] = max(dp[i], {dp[j].first, j});
      }
      dp[i].first += ((int)(where[i].size()));
    }
  }
  vector<int> ans;
  int mx = 1;
  for (int i = (2); i < (m); ++i) {
    if (dp[i].first > dp[mx].first) mx = i;
  }
  int cur = mx;
  while (cur) {
    for (int el : where[cur]) ans.push_back(el);
    cur = dp[cur].second;
  }
  reverse(ans.begin(), ans.end());
  if (!forbid[0]) ans.push_back(0);
  cout << ((int)(ans.size())) << "\n";
  int prev = 1;
  int fi = 0;
  for (int i = (2); i < (m); ++i)
    if (gcd(i, m) == 1) ++fi;
  for (int nxt : ans) {
    int a = prev / gcd(m, prev);
    long long pr = (long long)nxt * pw(a, fi, m);
    pr = pr / gcd(m, prev) % m;
    cout << pr << " ";
    prev = nxt;
  }
}
