#include <bits/stdc++.h>
using namespace std;
int a[51][51], d[51], q[51];
int n, m;
long long max1;
void dequy(int i0) {
  int i;
  for (i = 1; i <= n; i++) {
    if (a[i0][i] == 1 && d[i] == 0) {
      d[i] = 1;
      dequy(i);
    }
  }
}
void solve() {
  int i, j, x;
  max1 = 0;
  x = n;
  for (i = 1; i <= n; i++) {
    if (d[i] == 0) {
      dequy(i);
      x--;
    }
  }
  max1 = 1;
  for (i = 0; i < x; i++) {
    max1 *= 2;
  }
  cout << max1 << endl;
  for (i = 1; i <= n; i++) {
    d[i] = 0;
    for (j = 1; j <= n; j++) {
      a[i][j] = 0;
    }
  }
}
void input() {
  int i, x, y;
  while (cin >> n >> m) {
    for (i = 0; i < m; i++) {
      cin >> x >> y;
      a[x][y] = 1;
      a[y][x] = 1;
    }
    solve();
  }
}
int main() {
  input();
  return 0;
}
