#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int dr[] = {1, 0, -1, 0};
int dc[] = {0, 1, 0, -1};
int drow[] = {1, 1, 1, 0, -1, -1, -1, 0};
int dcol[] = {1, 0, -1, -1, -1, 0, 1, 1};
bool vis[100];
vector<int> v[100];
map<int, int> m1;
vector<pair<int, int> > s;
long long ans;
void dfs(int i) {
  vis[i] = true;
  for (int j = 0; j < v[i].size(); j++) {
    if (!vis[v[i][j]]) {
      ans *= 2;
      dfs(v[i][j]);
    }
  }
  return;
}
int main() {
  int i, n, x, y, t, j;
  int m;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    m1[i] = 0;
    v[i].clear();
  }
  memset(vis, false, sizeof(vis));
  s.clear();
  for (i = 0; i < m; i++) {
    cin >> x >> y;
    x--;
    y--;
    v[x].push_back(y);
    v[y].push_back(x);
    m1[x]++;
    m1[y]++;
  }
  for (i = 0; i < n; i++) {
    if (m1[i] > 0) {
      s.push_back(make_pair(m1[i], i));
    }
  }
  ans = 1;
  i = 0;
  int flag = 1;
  sort(s.begin(), s.end());
  reverse(s.begin(), s.end());
  for (i = 0; i < s.size(); i++) {
    if (!vis[s[i].second]) {
      dfs(s[i].second);
    }
  }
  cout << ans << "\n";
  return 0;
}
