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 max_n = 200022, log_n = 32, max_m = 111, mod = 1000000007,
                inf = 1000000009;
int n, m, a[max_n], eul[max_n], ptr[max_n], num[max_n], cnt[max_n], dp[max_n];
vector<int> p, pp, ppp[max_n];
vector<int> v[max_n], back_edge[max_n];
void get_eul() {
  for (int i = 2; i < m; ++i) {
    if (eul[i] == 0) {
      p.push_back(i);
      eul[i] = i;
    }
    for (int q = 0; q < p.size() && p[q] <= i && 1LL * p[q] * i < m; ++q) {
      eul[p[q] * i] = p[q];
    }
  }
}
vector<pair<int, int> > get_fact(int x) {
  vector<pair<int, int> > ans;
  while (x != 1) {
    if (ans.size() == 0 || ans.back().first != eul[x]) {
      ans.push_back(make_pair(eul[x], 1));
    } else {
      ans.back().second++;
    }
    x /= eul[x];
  }
  return ans;
}
void get_del(int m) {
  for (int i = 1; i < m; ++i) {
    if (m % i == 0) {
      ptr[i] = pp.size();
      pp.push_back(i);
    }
  }
}
void get_cnt() {
  for (int i = 0; i < pp.size(); ++i) {
    for (int q = 1; q * pp[i] < m; ++q) {
      num[pp[i] * q] = i;
    }
  }
  for (int i = 1; i < m; ++i) {
    if (!a[i]) {
      cnt[num[i]]++;
      ppp[num[i]].push_back(i);
    }
  }
}
void get_v() {
  for (int i = pp.size() - 1; i >= 0; --i) {
    vector<pair<int, int> > fact = get_fact(pp[i]);
    for (int q = 0; q < fact.size(); ++q) {
      v[ptr[pp[i] / fact[q].first]].push_back(i);
      back_edge[i].push_back(ptr[pp[i] / fact[q].first]);
    }
  }
}
int used[max_n];
vector<int> bfs() {
  int cur = 0;
  dp[0] = cnt[0];
  queue<int> q;
  q.push(cur);
  int mx = dp[0], mxx = 0;
  while (q.size()) {
    cur = q.front();
    q.pop();
    if (mx < dp[cur]) {
      mx = dp[cur];
      mxx = cur;
    }
    for (int i = 0; i < v[cur].size(); ++i) {
      dp[v[cur][i]] = max(dp[v[cur][i]], dp[cur] + cnt[v[cur][i]]);
      if (!used[v[cur][i]]) {
        used[v[cur][i]] = 1;
        q.push(v[cur][i]);
      }
    }
  }
  cur = mxx;
  vector<int> ans;
  while (cur) {
    ans.push_back(cur);
    for (int i = 0; i < back_edge[cur].size(); ++i) {
      if (dp[back_edge[cur][i]] + cnt[cur] == dp[cur]) {
        cur = back_edge[cur][i];
        break;
      }
    }
  }
  ans.push_back(0);
  reverse(ans.begin(), ans.end());
  return ans;
}
int gcd(int a, int b, long long& x, long long& y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long privet1, privet3;
  int d = gcd(b % a, a, privet1, privet3);
  x = privet3 - (b / a) * privet1;
  y = privet1;
  return d;
}
vector<int> go(int p) {
  int cur = ppp[p][0];
  vector<int> ans;
  for (int i = 1; i < ppp[p].size(); ++i) {
    long long x, y;
    int g = gcd(cur, m, x, y);
    x = ((x % m + m) * ppp[p][i] / g) % m;
    ans.push_back(x);
    cur = ppp[p][i];
  }
  return ans;
}
vector<int> get_indx(vector<int> p) {
  vector<int> ans(1, ppp[p[0]][0]);
  for (int i = 0; i < p.size(); ++i) {
    vector<int> res = go(p[i]);
    for (int q = 0; q < res.size(); ++q) {
      ans.push_back(res[q]);
    }
    if (i != p.size() - 1) {
      long long x, y;
      int g = gcd(ppp[p[i]].back(), m, x, y);
      x = (x % m + m) * ppp[p[i + 1]][0] / g % m;
      ans.push_back(x);
    }
  }
  if (a[0] != 1) {
    ans.push_back(0);
  }
  return ans;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    int b;
    scanf("%d", &b);
    a[b] = 1;
  }
  if (m == 1) {
    cout << "1\n0\n";
    return 0;
  }
  get_eul();
  get_del(m);
  get_cnt();
  get_v();
  vector<int> pppp = bfs();
  vector<int> ans = get_indx(pppp);
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); ++i) {
    cout << ans[i] << " ";
  }
  return 0;
}
