#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define popcount __builtin_popcount using namespace std; typedef long long int ll; typedef pair P; const ll MOD=998244353; ll powmod(ll a, ll k){ ll ap=a, ans=1; while(k){ if(k&1){ ans*=ap; ans%=MOD; } ap=ap*ap; ap%=MOD; k>>=1; } return ans; } ll inv(ll a){ return powmod(a, MOD-2); } ll f[1000010], invf[1000010]; void fac(int n){ f[0]=1; for(ll i=1; i<=n; i++) f[i]=f[i-1]*i%MOD; invf[n]=inv(f[n]); for(ll i=n-1; i>=0; i--) invf[i]=invf[i+1]*(i+1)%MOD; } ll comb(int x, int y){ if(!(0<=y && y<=x)) return 0; return f[x]*invf[y]%MOD*invf[x-y]%MOD; } struct unionfind{ vector par, sz; unionfind() {} unionfind(int n):par(n), sz(n, 1){ for(int i=0; isz[y]) swap(x, y); par[x]=y; sz[y]+=sz[x]; } bool same(int x, int y){ return find(x)==find(y); } int size(int x){ return sz[find(x)]; } }; int n, m; int a[20], b[20]; ll dp[1<<15]; map memo; int main() { cin>>n>>m; for(int i=0; i>a[i]>>b[i]; a[i]--; b[i]--; } fac(n); unionfind uf(n); for(int i=0; i<(1< deg; int c=0, l=0; int myon=0; for(int j=0; j1) continue; for(auto p:deg) uf.par[p.first]=p.first, uf.sz[p.first]=1; if(myon){ bool cyc=1; for(auto p:deg){ if(p.second!=2) cyc=0; } if(cyc) dp[i]=1; continue; } int t=deg.size(); for(auto p:deg){ if(p.second==1) l++; } if(l!=2*(t-c)) continue; if(memo.find({t, c})!=memo.end()){ dp[i]=memo[{t, c}]; continue; } for(int k=max(0, 3-t); k<=n-t; k++){ (dp[i]+=comb(n-t, k)*f[t-c+k-1])%=MOD; } dp[i]=dp[i]*powmod(2, t-c)%MOD*((MOD+1)/2)%MOD; memo[{t, c}]=dp[i]; } for(int i=(1<=0; i--){ int x=(1<0; j=(j-1)&x){ dp[i]+=MOD-dp[i^j]; } dp[i]%=MOD; } cout<