#include <bits/stdc++.h>
using namespace std;
int ar[55];
vector<int> v[55];
long long ans = 1;
int z;
int k;
bool br[55];
void dfs(int g) {
  int i;
  br[g] = 1;
  for (i = 0; i < v[g].size(); i++) {
    if (br[v[g][i]] == 0) {
      dfs(v[g][i]);
      ans = 2 * ans;
    }
  }
}
int main() {
  int n;
  int m;
  cin >> n >> m;
  for (int i = 0; (i) < (m); ++i) {
    int a;
    int b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = 0; (i) < (55); ++i) {
    if (v[i].size() == 0) continue;
    if (br[i] == 0) dfs(i);
  }
  cout << ans << "\n";
  return 0;
}
