#include <bits/stdc++.h>
using namespace std;
long long ans = 1;
vector<long long> a[60];
long long v[100] = {};
void dfs(long long n, long long p) {
  if (v[n]) return;
  v[n]++;
  if (p != -1) ans *= 2;
  if (!a[n].empty())
    for (auto x : a[n]) {
      if (x != p) dfs(x, n);
    }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, l, r;
  cin >> n >> m;
  while (m--) {
    cin >> l >> r;
    a[l].push_back(r);
    a[r].push_back(l);
  }
  long long i = 1;
  while (i <= n) {
    if (!v[i]) {
      dfs(i, -1);
    }
    i++;
  }
  cout << ans << "\n";
  ;
}
