#include <bits/stdc++.h>   using namespace std;   const long long INF = 4e18;   const long long MAX = 2e5 + 5;   const long long MOD = 1e9 + 7;   int n, m;   void exgcd(int a, int b, long long &c, long long &d) {     if (a == 0) {       c = 0;       d = 1;       return;     }     exgcd(b % a, a, d, c);     c -= b / a * d;   }   long long gcd(int a, int b) {     if (a == 0) return b;     return gcd(b % a, a);   }   int g[MAX];   bool arv[MAX], avb[MAX];   int sz[MAX];   pair<int, int> ma[MAX];   vector<int> v;   vector<int> son[MAX];   void build() {     for (int i = 0; i < m; i++) {       g[i] = gcd(i, m);       sz[g[i]]++;       son[g[i]].push_back(i);     }     g[m] = m;     int x = m;     for (int i = 2; i <= sqrt(x); i++) {       if (x % i == 0) v.push_back(i);       while (x % i == 0) x /= i;     }     if (x > 1) v.push_back(x);   }   void read() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cin >> n >> m;     build();     for (int i = 0; i < n; i++) {       int x;       cin >> x;       avb[x] = 1;       if (!x) avb[m] = 1;       sz[gcd(x, m)]--;     }   }   void dfs(long long x) {     if (arv[x]) return;     for (int i : v) {       if (i * x > m) break;       if (g[i * x] == i * x) {         dfs(i * x);         ma[x] = max(ma[x], {ma[i * x].first, i * x});       }     }     ma[x].first += sz[x];     ;     arv[x] = 1;   }   vector<int> ans;   void output() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout << ((long long)(ans).size()) <<   n ;     for (int i : ans) cout << i <<    ;     cout <<   n ;     ;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     read();     for (int i = 1; i <= m; i++)       if (g[i] == i && !arv[i]) dfs(i);     long long now = 1, pre = 1;     long long cod;     while (now <= m) {       ;       for (long long i : son[now]) {         if (!avb[i]) {           long long r, y;           exgcd(pre, m, r, y);           if (r < 0) r += m;           ans.push_back(i / gcd(pre, m) * r % m);           pre = i;         }       }       if (ma[now].second)         now = ma[now].second;       else         break;     }     output();     return 0;   }   