#include <cstdio>
using namespace std;
int n, m, fa[100], x, y;
int gf(int x) {
if (fa[x] != x) fa[x] = gf(fa[x]);
return fa[x];
}
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++) fa[i] = i;
while (m--) {
scanf("%d%d", &x, &y);
fa[gf(x)] = gf(y);
}
long long ans = (1LL << n);
for (int i = 1; i <= n; i++)
if (gf(i) == i) ans /= 2;
printf("%I64d\n", ans);
}
I2luY2x1ZGUgPGNzdGRpbz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBuLCBtLCBmYVsxMDBdLCB4LCB5OwoKaW50IGdmKGludCB4KSB7CglpZiAoZmFbeF0gIT0geCkJZmFbeF0gPSBnZihmYVt4XSk7CglyZXR1cm4gZmFbeF07Cn0KCmludCBtYWluKCkgewoJc2NhbmYoIiVkJWQiLCAmbiwgJm0pOwoJZm9yIChpbnQgaSA9IDE7IGkgPD0gbjsgaSsrKQlmYVtpXSA9IGk7Cgl3aGlsZSAobS0tKSB7CgkJc2NhbmYoIiVkJWQiLCAmeCwgJnkpOwoJCWZhW2dmKHgpXSA9IGdmKHkpOwoJfQoJbG9uZyBsb25nIGFucyA9ICgxTEwgPDwgbik7Cglmb3IgKGludCBpID0gMTsgaSA8PSBuOyBpKyspCgkJaWYgKGdmKGkpID09IGkpCWFucyAvPSAyOwoJcHJpbnRmKCIlSTY0ZFxuIiwgYW5zKTsKfQo=