#include <bits/stdc++.h>
using namespace std;
vector<int> adjList[60];
queue<int> Q;
int visited[60];
int n, m;
long long sol = 1;
void bfs(int start) {
  Q.push(start);
  visited[start] = 1;
  while (!Q.empty()) {
    int u = Q.front();
    Q.pop();
    for (int i = 0; i < adjList[u].size(); i++) {
      int v = adjList[u][i];
      if (visited[v] == 0) {
        Q.push(v);
        visited[v] = visited[u] + 1;
        sol *= 2;
      }
    }
  }
}
int main() {
  cin >> n >> m;
  if (m == 0) {
    cout << "1" << endl;
  } else {
    int toStart[55];
    memset(toStart, 0, sizeof(toStart));
    memset(visited, 0, sizeof(visited));
    for (int i = 0; i < m; i++) {
      int a, b;
      cin >> a >> b;
      adjList[a].push_back(b);
      adjList[b].push_back(a);
      toStart[a]++;
      toStart[b]++;
    }
    for (int i = 1; i <= n; i++) {
      if (toStart[i] == 1 && (!visited[i])) {
        bfs(i);
      }
    }
    for (int i = 1; i <= n; i++) {
      if (!visited[i]) {
        bfs(i);
      }
    }
    cout << sol << endl;
  }
  return 0;
}
