#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int N, M;
vector<vector<int>> G(N);
bool visited[100];
vector<pair<int,int>> E1;
set<pair<int,int>> E2;
void f(int p) {
	visited[p] = true;
	for (int x : G[p]) {
		if (visited[x]) {
			E2.insert({min(p,x),max(x,p)});
		} else {
			E1.push_back({p,x});
			f(x);
		}
	}
}
int main() {
	cin >> N >> M;
	G.resize(N);
	for (int i = 0; i < M; ++ i) {
		int u, v;
		cin >> u >> v;
		-- u; -- v;
		G[u].push_back(v);
		G[v].push_back(u);
	}
	ll res = 1;
	vector<int> color(N);
	for (int i = 0; i < N; ++ i) if (!visited[i]) {
		E1.clear();
		E2.clear();
		f(i);
		for (auto [u,v] : E1) E2.erase({min(u,v),max(u,v)});
		int rr = 0;
		for (int p = 0; p < (1<<E1.size()); ++ p) {
			for (unsigned i = 0; i < E1.size(); ++ i) {
				auto [u, v] = E1[i];
				int cc[2];
				for (int k = 0, j = 0; k < 3; ++ k) if (k != color[u]) cc[j++] = k;
				color[v] = cc[(p>>i)&1];
			}
			for (auto [u, v] : E2) {
				if (color[u] == color[v]) goto next;
			}
			++ rr;
			next:;
		}
		res *= rr*3;
	}
	cout << res << endl;
}

#include<algorithm>
#include<bitset>
#include<cassert>
#include<cfloat>
#include<climits>
#include<cmath>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;

using lint = long long;
using P = pair<int, int>;
using LLP = pair<long long, long long>;

#define REP(i, x, n) for(int i = (x), i##_len = (int)(n) ; i < i##_len ; ++i)
#define rep(i, n) for(int i = 0, i##_len = (int)(n) ; i < i##_len ; ++i)
#define reps(i, n) for(int i = 1, i##_len = (int)(n) ; i <= i##_len ; ++i)
#define rrep(i, n) for(int i = (int)(n) - 1 ; i >= 0 ; --i)
#define rreps(i, n) for(int i = (int)(n) ; i > 0 ; --i)
#define SORT(x) sort((x).begin(), (x).end())
#define SORT_INV(x) sort((x).rbegin(), (x).rend())
#define REVERSE(x) reverse((x).begin(), (x).end())
#define TWINS(x) cout << ((x) ? "Yay!" : ":(") << '\n'

constexpr int IINF = (1 << 30) - 1;
constexpr long long LLINF = 1LL << 61;
constexpr double EPS = 1e-10;

constexpr int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
constexpr int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};

template<typename T>
bool chmax(T& a, T b){
    if(a < b){
        a = b;
        return true;
    }
    return false;
}

template<typename T>
bool chmin(T& a, T b){
    if(b < a){
        a = b;
        return true;
    }
    return false;
}

bool dfs(int v, int c, vector<int>& col, const vector< vector<int> >& g){
    col[v] = c;

    bool ret = true;

    for(auto to : g[v]){
        if(col[to] == -1){
            ret &= dfs(to, c ^ 1, col, g);
        }else if(col[v] == col[to]){
            return false;
        }
    }

    return ret;
}

template<class T>
T power(T x, unsigned long long n){
    T res = T(1);
    while(n){
        if(n & 1ull){
            res *= x;
        }
        x *= x;
        n >>= 1;
    }
    return res;
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    int n, m;
    cin >> n >> m;

    vector< P > es;

    rep(i, m){
        int a, b;
        cin >> a >> b;
        es.emplace_back(a - 1, b - 1);
    }

    lint ans = 0;

    rep(bit, 1 << n){
        bool flg = true;
        vector< vector<int> > g(n);

        rep(i, m){
            int a = es[i].first;
            int b = es[i].second;

            if((bit >> a & 1) && (bit >> b & 1)){
                flg = false;
                break;
            }else if(!(bit >> a & 1) && !(bit >> b & 1)){
                g[a].emplace_back(b);
                g[b].emplace_back(a);
            }
        }

        if(!flg){
            continue;
        }

        vector<int> col(n, -1);

        lint tmp = 1;

        rep(i, n){
            if((bit >> i & 1) || col[i] != -1){
                continue;
            }

            if(!dfs(i, 0, col, g)){
                tmp = 0;
                flg = false;
                break;
            }

            tmp *= 2;
        }

        ans += tmp;
    }

    cout << ans << endl;

    cout << flush;

    return 0;
}