#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for (int i = 0; i < n; i++)

vector<vector<int>> to;

vector<int> used;
vector<int> col;
vector<int> vs;

ll now;
int n;

void dfs(int v) {
  if (used[v]) return;
  used[v] = 1;
  vs.push_back(v);
  for (int u: to[v]) dfs(u);
}

void dfs2(int i) {
  if (i == vs.size()) { now++; return; }
  int v = vs[i];
  rep(c, 3) {
    col[v] = c;
    bool ok = true;
    for (int u: to[v]) {
      if (col[u] == c) ok = false;
    }
    if (!ok) continue;
    dfs2(i+1);
  }
  col[v] = -1;
}

int main() {
  int m;
  cin >> n >> m;
  to = vector<vector<int>>(n);
  rep(i, m) {
    int a,b;
    cin >> a >> b;
    --a, --b;
    to[a].push_back(b);
    to[b].push_back(a);
  }
  ll ans = 1;
  used = vector<int>(n);
  col = vector<int>(n, -1);
  rep(i,n) {
    if (used[i]) continue;
    vs = vector<int>();
    dfs(i);
    col[vs[0]] = 0;
    now = 0;
    dfs2(1);
    ans *= 3 * now;
  }
  cout << ans << endl;
}
#include <bits/stdc++.h>
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	int n, m;
	cin >> n >> m;

	vector<vector<int>> adj(n, vector<int>(n));
	for (int i = 0, u, v; i < m; i++) {
		cin >> u >> v, --u, --v;
		adj[u][v] = adj[v][u] = 1;
	}

	vector<int> is_independent(1 << n, 1);
	for (int mask = 1; mask < (1 << n); mask++) {
		int &f = is_independent[mask];
		int msb = 32 - __builtin_clz(mask) - 1;

		f = is_independent[mask ^ (1 << msb)];

		for (int i = 0; i < msb; i++) {
			if (mask >> i & 1) {
				f &= !adj[i][msb];
			}
		}
	}

	long long ans = 0;
	const int all = (1 << n) - 1;

	for (int mask = 0; mask < (1 << n); mask++) {
		vector<int> col(n, -1);
		auto dfs = [&](int x, const auto &self) -> void {
			for (int i = 0; i < n; i++) {
				if ((mask >> i & 1) && adj[x][i] && col[i] == -1) {
					col[i] = 1 ^ col[x];
					self(i, self);
				}
			}
		};

		int comps = 0;
		for (int i = 0; i < n; i++) {
			if ((mask >> i & 1) && col[i] == -1) {
				col[i] = 0;
				dfs(i, dfs);
				comps += 1;
			}
		}

		bool is_bipartite = true;
		for (int i = 0; i < n; i++) {
			if ((mask >> i & 1)) {
				for (int j = 0; j < i; j++) {
					if ((mask >> j & 1) && adj[i][j]) {
						is_bipartite &= col[i] != col[j];
					}
				}
			}
		}

		ans += is_bipartite * is_independent[all ^ mask] * (1ll << comps);
	}
	cout << ans << '\n';
	return 0;
}