#include #ifdef LOCAL #include #else #define debug(...) void(0) #endif namespace internal { template std::vector> ranked_zeta(const std::vector& a) { int n = a.size(), len = __builtin_ctz(n); assert((n & (n - 1)) == 0); std::vector> res(n); for (int i = 0; i < n; i++) res[i][__builtin_popcount(i)] = a[i]; for (int step = 1; step < n; step <<= 1) { for (int start = 0; start < n; start += 2 * step) { for (int i = start; i < start + step; i++) { for (int j = 0; j <= len; j++) { res[i | step][j] += res[i][j]; } } } } return res; } template std::vector ranked_mobius(std::vector>& ranked) { int n = ranked.size(), len = __builtin_ctz(n); assert((n & (n - 1)) == 0); for (int step = 1; step < n; step <<= 1) { for (int start = 0; start < n; start += 2 * step) { for (int i = start; i < start + step; i++) { for (int j = 0; j <= len; j++) { ranked[i | step][j] -= ranked[i][j]; } } } } std::vector res(n); for (int i = 0; i < n; i++) res[i] = ranked[i][__builtin_popcount(i)]; return res; } } // namespace internal template std::vector subset_convolution(const std::vector& a, const std::vector& b) { auto ra = internal::ranked_zeta(a); auto rb = internal::ranked_zeta(b); int n = ra.size(), len = __builtin_ctz(n); for (int i = 0; i < n; i++) { auto &f = ra[i], &g = rb[i]; for (int j = len; j >= 0; j--) { T sum = 0; for (int k = 0; k <= j; k++) sum += f[k] * g[j - k]; f[j] = sum; } } return internal::ranked_mobius(ra); } template std::vector exp_of_set_power_series(std::vector& a) { int n = __builtin_ctz(a.size()); assert(int(a.size()) == 1 << n and a[0] == T(0)); std::vector res(1 << n); res[0] = T(1); for (int i = 0; i < n; i++) { std::vector f(begin(a) + (1 << i), begin(a) + (2 << i)); std::vector g(begin(res), begin(res) + (1 << i)); auto h = subset_convolution(f, g); std::copy(begin(h), end(h), begin(res) + (1 << i)); } return res; } using namespace std; typedef long long ll; #define all(x) begin(x), end(x) constexpr int INF = (1 << 30) - 1; constexpr long long IINF = (1LL << 60) - 1; constexpr int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; template istream& operator>>(istream& is, vector& v) { for (auto& x : v) is >> x; return is; } template ostream& operator<<(ostream& os, const vector& v) { auto sep = ""; for (const auto& x : v) os << exchange(sep, " ") << x; return os; } template bool chmin(T& x, U&& y) { return y < x and (x = forward(y), true); } template bool chmax(T& x, U&& y) { return x < y and (x = forward(y), true); } template void mkuni(vector& v) { sort(begin(v), end(v)); v.erase(unique(begin(v), end(v)), end(v)); } template int lwb(const vector& v, const T& x) { return lower_bound(begin(v), end(v), x) - begin(v); } int topbit(signed t) { return t == 0 ? -1 : 31 - __builtin_clz(t); } int topbit(long long t) { return t == 0 ? -1 : 63 - __builtin_clzll(t); } int botbit(signed a) { return a == 0 ? 32 : __builtin_ctz(a); } int botbit(long long a) { return a == 0 ? 64 : __builtin_ctzll(a); } int popcount(signed t) { return __builtin_popcount(t); } int popcount(long long t) { return __builtin_popcountll(t); } bool ispow2(int i) { return i && (i & -i) == i; } long long MSK(int n) { return (1LL << n) - 1; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, m; cin >> n >> m; vector G(n, 0); for (; m--;) { int u, v; cin >> u >> v; u--, v--; G[u] |= 1 << v; G[v] |= 1 << u; } vector c(1 << n, 0); { vector dp(1 << n, vector(n, vector(n, 0))); for (int i = 0; i < n; i++) { dp[1 << i][i][i] = 1; c[1 << i] += 1; } for (int mask = 0; mask < 1 << n; mask++) { for (int start = 0; start < n; start++) { for (int cur = 0; cur < n; cur++) { ll& val = dp[mask][start][cur]; if (val == 0) continue; for (int nxt = 0; nxt < n; nxt++) { if (mask >> nxt & 1) continue; if (~G[cur] >> nxt & 1) continue; dp[mask | 1 << nxt][start][nxt] += val; } if (__builtin_popcount(mask) > 2 and (G[cur] >> start & 1)) c[mask] += val; } } } for (int mask = 0; mask < 1 << n; mask++) { if (popcount(mask) == 1) continue; ll& val = c[mask]; if (val == 0) continue; val /= popcount(mask) * 2; } } vector f(1 << n); f[0] = 0; for (int C = 1; C < 1 << n; C++) { int p = topbit(C); vector rest; for (int i = 0; i < p; i++) { if (~C >> i & 1) { rest.emplace_back(i); } } auto convert = [&](int mask) { int res = 0; for (int i = 0; i < int(rest.size()); i++) { if (mask >> i & 1) { res |= 1 << rest[i]; } } return res; }; int len = rest.size(); vector g(1 << len); for (int T = 0; T < 1 << len; T++) { int U = convert(T), es = 0; for (int i = 0; i < p; i++) { if (U >> i & 1) { es += popcount(G[i] & C); } } g[T] = f[U] * es; } g = exp_of_set_power_series(g); for (int T = 0; T < 1 << len; T++) f[convert(T) | C] += g[T] * c[C]; } f = exp_of_set_power_series(f); ll ans = f.back(); cout << ans << '\n'; return 0; }