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;
long long LST = 1;
long long divide_gcd(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 d = divide_gcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
long long xx(long long a, long long b, long long c) {
  long long d, x, y;
  d = divide_gcd(a, b, x, y);
  a = a / d;
  b = b / d;
  c = c / d;
  d = divide_gcd(a, b, x, y);
  x = x * c;
  y = y * c;
  long long new_x, new_y;
  new_x = (x % b + b) % b;
  new_y = (c - new_x * a) / b;
  return new_x;
}
long long divide(long long a, long long b, long long m) {
  long long x = xx(a, -m, b);
  x = (x % m);
  if (x < 0) x += m;
  return x;
}
const int mx = 300000;
int n, m, sz[mx], dp[mx], p[mx];
bool used[mx];
vector<int> num[mx], way;
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int count_dp(int x) {
  if (dp[x] != -1) return dp[x];
  if (x == 1) {
    dp[x] = sz[x];
    return dp[x];
  }
  dp[x] = 0;
  for (int i = 1; i * i <= x; ++i) {
    if (x % i == 0) {
      if (i != x) {
        if (sz[x] + count_dp(i) > dp[x]) {
          dp[x] = sz[x] + count_dp(i);
          p[x] = i;
        }
      }
      if ((x / i) != x) {
        if (sz[x] + count_dp(x / i) > dp[x]) {
          dp[x] = sz[x] + count_dp(x / i);
          p[x] = x / i;
        }
      }
    }
  }
  return dp[x];
}
void print(int x, int lst) {
  for (int i = 0; i < sz[x]; ++i) {
    if (i == 0) {
      cout << divide(lst, num[x][i], m) << " ";
    } else {
      cout << divide(num[x][i - 1], num[x][i], m) << " ";
    }
    LST = num[x][i];
  }
}
int main() {
  for (int i = 0; i < mx; ++i) {
    used[i] = 0;
    sz[i] = 0;
    dp[i] = -1;
    p[i] = -1;
  }
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    int temp;
    cin >> temp;
    used[temp] = 1;
  }
  for (int i = 0; i < m; ++i) {
    if (used[i] == 0) {
      int g = gcd(i, m);
      num[g].push_back(i);
      sz[g]++;
    }
  }
  count_dp(m);
  int pointer = m;
  way.push_back(m);
  while (pointer != 1) {
    pointer = p[pointer];
    way.push_back(pointer);
  }
  cout << dp[m] << endl;
  LST = 1;
  for (int i = way.size() - 1; i >= 0; --i) {
    print(way[i], LST);
  }
  return 0;
}
