#include using namespace std; #define int long long #define ii pair #define app push_back #define all(a) a.begin(), a.end() #define bp __builtin_popcountll #define ll long long #define mp make_pair #define f first #define s second #define Time (double)clock()/CLOCKS_PER_SEC #define debug(x) std::cout << #x << ": " << x << '\n'; const int N = 1e5+7; vector g[N]; const int MOD = 998244353; int mod(int n) { n %= MOD; if (n < 0) return n + MOD; else return n; } int fp(int a, int p) { int ans = 1, c = a; for (int i = 0; (1ll << i) <= p; ++i) { if ((p >> i) & 1) ans = mod(ans * c); c = mod(c * c); } return ans; } int dv(int a, int b) { return mod(a * fp(b, MOD - 2)); } int f[N], inv[N]; void prec() { f[0] = 1; for (int i = 1; i < N; ++i) f[i] = mod(f[i - 1] * i); inv[N - 1] = fp(f[N - 1], MOD - 2); for (int i = N - 2; i >= 0; --i) inv[i] = mod(inv[i + 1] * (i + 1)); } int C(int n, int k) { return mod(f[n] * mod(inv[k] * inv[n - k])); } bool used[N]; void dfs(int u) { used[u] = 1; for (int v : g[u]) if (!used[v]) dfs(v); } signed main() { #ifdef HOME freopen("input.txt", "r", stdin); #else #define endl '\n' ios_base::sync_with_stdio(0); cin.tie(0); #endif prec(); int n, m; cin >> n >> m; vector ed; for (int i = 0; i < m; ++i) { int u, v; cin >> u >> v; ed.app(mp(u, v)); } int ans = 0; for (int sz = 3; sz <= n; ++sz) { ans = mod(ans + C(n, sz) * mod(f[sz - 1] * inv[2])); } //debug(ans); for (int mask = 1; mask < (1 << m); ++mask) { vector c; for (int i = 0; i < m; ++i) if ((mask >> i) & 1) { g[ed[i].f].app(ed[i].s); g[ed[i].s].app(ed[i].f); c.app(ed[i].f); c.app(ed[i].s); } sort(all(c)); c.resize(unique(all(c)) - c.begin()); bool bad = 0; for (int u : c) { if (g[u].size() > 2) bad = 1; } //calc memset(used, 0, sizeof used); int pa = 0; for (int u : c) { if (!used[u]) { ++pa; dfs(u); } } int cnt = c.size(); for (auto e : c) g[e].clear(); if (!bad && pa == 1 && cnt == bp(mask)) { //one cycle ans = mod(ans - 1); continue; } if (bp(mask) != cnt - pa) { bad = 1; } if (bad) continue; int delt = 0; if (pa == 1) { if (cnt >= 3) { delt = 1; } int t = 1; for (int add = 1; cnt + add <= n; ++add) { t = mod(t * add); if (cnt + add >= 3) delt = mod(delt + t * C(n - cnt, add)); } } else { int t = mod(f[pa - 1] * fp(2, pa - 1)); if (cnt >= 3) { delt = t; } for (int add = 1; cnt + add <= n; ++add) { t = mod(t * (pa + add - 1)); if (cnt + add >= 3) { delt = mod(delt + t * C(n - cnt, add)); } } } //debug(mask); //debug(delt); if (bp(mask) & 1) ans = mod(ans - delt); else ans = mod(ans + delt); } cout << ans << endl; }