//新生训练
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
bool a[60][60];
bool vis[60];
int n;
long long int cnt;
void bfs(int x)
{int y;queue<int> q;vis[x] = true;q.push(x);while (!q.empty()){y = q.front();q.pop();for (int i = 1; i <= n; i++){if (a[y][i] && !vis[i]){cnt *= 2;vis[i] = true;q.push(i);}}}return;
}
int main()
{int m, u, v;while (cin >> n >> m){cnt = 1;memset(vis, 0, sizeof(vis));memset(a, 0, sizeof(a));for (int i = 0; i < m; i++){cin >> u >> v;a[u][v] = true;a[v][u] = true;}for (int i = 1; i <= n; i++)if (!vis[i]){bfs(i);}cout << cnt << endl;}return 0;
}
//遍历,选择,计数;
~~~//仅当笔者个人备忘录使用。