#include <bits/stdc++.h>
using namespace std;
int n, m;
bool visited[51];
vector<int> g[51];
long long int danger = 1;
void dfs(int v) {
  visited[v] = true;
  for (int x : g[v]) {
    if (visited[x] == false) {
      danger *= 2;
      dfs(x);
    }
  }
}
int main() {
  cin >> n >> m;
  while (m--) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    if (visited[i] == false) dfs(i);
  }
  cout << danger << endl;
}
