#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110;
vector<int> a[MAXN];
bool mark[MAXN];
void dfs(int x) {
  mark[x] = true;
  for (int i = 0; i < a[x].size(); i++)
    if (mark[a[x][i]] == false) dfs(a[x][i]);
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  long long ans = pow(2, n), b = 1;
  for (int i = 1; i <= n; i++)
    if (mark[i] == false) dfs(i), b *= 2;
  cout << ans / b << endl;
  return 0;
}
