#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <numeric>
#include <array>
#include <complex>

using namespace std;
 
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#define int long long
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define trav(i, a) for (auto &i: (a))
#define sz(x) (int)(x).size()
#define all(v) v.begin(), v.end()
#define fr(i, a, b) for (int i = (a); i <= (b); ++i)
 
typedef long long ll;
typedef long double ld;
 
void run_case();

int32_t main () {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(3);
    #ifndef ONLINE_JUDGE
    freopen("in", "r", stdin);
    #endif
    int t = 1;
    // cin >> t; 
    while (t--) { 
        run_case();
    }
    return 0;
}
const int N = 25;
vector<int> adj[N];
vector<int> nadj[N];
int n, m;
vector<int> vis;

bool dfs (int v, int c = 1) {
    vis[v] = c;
    bool ok = true;
    for (auto &i: nadj[v]) {
        if (vis[i] == 0) ok &= dfs(i, 3 ^ c);
        else if (vis[i] == vis[v]) return false;
    }
    return ok;
}

void run_case() {
    cin >> n >> m;
    vis.resize(n);
    for (int i = 0; i < m; ++i) {
        int a, b; cin >> a >> b; --a, --b;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
    int ans = 0;
    for (int mask = 0; mask < (1 << n); ++mask) {
        fill(all(vis), 0);
        for (int b = 0; b < n; ++b) {
            nadj[b].clear();
            if ((1 << b) & mask) {
                for (auto &j: adj[b]) {
                    if ((1 << j) & mask)
                        nadj[b].push_back(j);
                }
            }
        }
        int cnt = 0;
        bool ok = true;
        for (int b = 0; b < n; ++b) {
            if (vis[b]) continue;
            if ((1 << b) & mask) {
                if (dfs(b)) ++cnt;
                else {
                    ok = false; break;
                }
            }
        }
        if (!ok) continue;
        for (int b = 0; b < n; ++b) {
            if (!vis[b]) {
                for (auto j: adj[b]) {
                    if (!vis[j]) 
                        ok = false;
                }
            }
        }
        if (!ok) continue;
        int pw = 1;
        for (int j = 0; j < cnt; ++j)
            pw *= 2;
        ans += pw;
    }
    cout << ans;
}
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false)
#define rep(i, n) for(ll i=0; i<(ll)n; i++)
#define ALL(obj) begin(obj), end(obj)
typedef long long ll;
vector<vector<int> > G(22);
vector<int> color(22, -1), ts;
vector<bool> vis(22, 0); 
int n, m, a, b;

void dfs(int now){
	ts.push_back(now);
	vis[now]=1;
	
	for(int i: G[now]){
		if(vis[i])
		    continue;
		    
		dfs(i);
	}
}

ll DFS(int i){
	if(i==ts.size())
	    return 1;
	
	ll res=0;
    rep(j, 3){
    	bool f=1;
    	for(int x:G[ts[i]]){
    		if(color[x]==j){
    			f=0;
    			break;
			}
		}
		
		if(!f)
		   continue;
		   
		color[ts[i]]=j;
		res+=DFS(i+1);
		color[ts[i]]=-1;
	}
	
	return res;
}

int main()
{
    IOS;
	cin>>n>>m;
	rep(i, m){
		cin>>a>>b;
		a--;
		b--;
		
		G[a].push_back(b);
		G[b].push_back(a);
	}	
	
	ll ans=1;
	rep(i, n){
		if(vis[i])
		    continue;
		
		dfs(i);
		fill(ALL(color), -1);
		ans*=DFS(0);
		ts.clear();
	}
	
	cout<<ans<<endl;
	
	return 0;
}