#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

#define INF 1e7
#define st string
#define pb push_back
#define eb emplace_back
#define pii pair<int, int>
#define fopen freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define test(x) int t; cin >> t; while(t--) x();

//int dx[] = {0, 0, 1, -1};
//int dy[] = {1, -1, 0, 0};

vector<int>adj[100005];
queue<int>q;
bool vist[100005];
int n, m, a, b;

int dfs(int node){
    int res = 1;
    vist[node] = true;
    for(auto neigh : adj[node]){
        if(!vist[neigh]){
            res += dfs(neigh);
        }
    }
    return res;
}

void solve(){
    cin >> n >> m;
    for(int i = 0; i < m; i++) {
        cin >> a >> b;
        adj[a].pb(b);
        adj[b].pb(a);
    }
    int ans = 0;
    for(int i = 1; i <= n; i++){
        if(!vist[i]){
            //cout << "AQUI";
            ans += (dfs(i) - 1);
        }
    }
    cout << (1<<ans) << '\n';
}

int main(){
    fastio
    solve();
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

#define INF 1e7
#define st string
#define pb push_back
#define eb emplace_back
#define pii pair<int, int>
#define fopen freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define test(x) int t; cin >> t; while(t--) x();

//int dx[] = {0, 0, 1, -1};
//int dy[] = {1, -1, 0, 0};

vector<int>adj[100005];
//vector<int>comp;
queue<int>q;
bool vist[100005];
int n, m, a, b;

int bfs(int node){
    int res = 1;
    vist[node] = true;
    q.push(node);
    //comp.pb(node);
    while(!q.empty()) {
        int x = q.front(); q.pop();
        //if(vist[x]) continue;
        for (auto neigh : adj[x]) {
            if (!vist[neigh]) {
                vist[neigh] = true;
                res *= 2;
                //cout << "AQUI" << '\n';
                q.push(neigh);
            }
        }
    }
    return res;
}

void solve(){
    cin >> n >> m;
    for(int i = 0; i < m; i++) {
        cin >> a >> b;
        adj[a].pb(b);
        adj[b].pb(a);
    }
    int ans = 0;
    for(int i = 1; i <= n; i++){
        if(!vist[i]){
            //cout << "AQUI";
            //comp.clear();
            ans += bfs(i);
        }
    }
    cout << ans << '\n';
}

int main(){
    fastio
    solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

//defines...
#define ll long long
#define tata return;
#define pb push_back
#define mp make_pair
#define in insert
#define run ios_base::sync_with_stdio(false);cin.tie(NULL);
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define yes cout<<"Yes"<<endl;
#define no cout<<"No"<<endl;
#define vec vector<ll>
#define setl set<ll>
#define mapl map<ll,ll>
#define shunno cout<<0<<endl;
#define ek cout<<1<<endl;
#define pi 2*acos(0.0)
#define hobena cout<<-1<<endl;

//typedefs...
typedef pair<ll,ll>pll;

//const..
//const ll fx[]={0,1,0,-1};
//const ll fy[]={1,0,-1,0};
//const ll mod=1e9+7;
/*
ll ncr(ll n, ll k)
{
    ll res = 1;

    if (k > n - k)
        k = (n - k)%m;

    for (int i = 0; i < k; ++i) {
        res *= (n - i);
        res%=m;
        res /= (i + 1);
    }

    return res%m;
}

ll big_mod(ll base, ll power, ll mod)
{
    if(power==0)    return 1;

    else if(power%2==1)
    {
        ll p1 = base % mod;
        ll p2 = (big_mod(base,power-1,mod))%mod;
        return (p1*p2)%mod;
    }
    else if(power%2==0)
    {
        ll p1 = (big_mod(base,power/2,mod))%mod;
        return (p1*p1)%mod;
    }
}
*/

 //mapl maap;
/*
 void dfs(ll x)
 {
     vis[x]=1;
     pos=x;
     for(ll i: v1[x])
     {
         pos=i;
         if(maap[i]==1)
         {
             pos=i;
             tata

         }
         if(vis[i]==0)
         {

             vis[i]=1;
             dfs(i);
         }
     }
 }
 */

/*vec v;
ll a[10000003];
ll is_prime(ll x)
{
    ll i;
    for(i=2;i*i<=x;i++)
    {
        if(x%i==0)
            return 0;
    }
    return 1;
}
void sieve()
{
    ll i,j;
    for(i=2;i*i<10000000;i++)
    {
        if(a[i]==0)
        {
            for(j=i*2;j<=10000000;j+=i)
                a[j]=1;
        }
    }
    for(i=2;i<=10000000;i++)
    {
        if(a[i]==0)
            v.pb(i);
    }

}
*/
vec v[100];
ll cost[100];
ll cnt=0;
ll vis[100];
void dfs(ll x)
{
    vis[x]=1;

    for(auto y:v[x])
    {
        if(vis[y]==0)
        {
          vis[y]=1;
            cnt++;
            dfs(y);
        }
    }

}

void oka()
{
    ll n,m,i,j,k;
    cin>>n>>m;
    ll cost[n+1];

    ll x,y;
    ll ans=0;
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        v[x].pb(y);
        v[y].pb(x);

    }
    for(i=1;i<=n;i++)
    {
        if(vis[i]==0)
        {
            dfs(i);
            ans=max(ans,cnt);
            cnt=0;
        }
    }

        cout<<ans*2<<endl;

}

int main()
{

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    run
    ll t;
    t=1;

 // cin>>t;
  while(t--)
        oka();
}


#include<bits/stdc++.h>
using namespace std;

//defines...
#define ll long long
#define tata return;
#define pb push_back
#define mp make_pair
#define in insert
#define run ios_base::sync_with_stdio(false);cin.tie(NULL);
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define yes cout<<"Yes"<<endl;
#define no cout<<"No"<<endl;
#define vec vector<ll>
#define setl set<ll>
#define mapl map<ll,ll>
#define shunno cout<<0<<endl;
#define ek cout<<1<<endl;
#define pi 2*acos(0.0)
#define hobena cout<<-1<<endl;

//typedefs...
typedef pair<ll,ll>pll;

//const..
//const ll fx[]={0,1,0,-1};
//const ll fy[]={1,0,-1,0};
//const ll mod=1e9+7;
/*
ll ncr(ll n, ll k)
{
    ll res = 1;

    if (k > n - k)
        k = (n - k)%m;

    for (int i = 0; i < k; ++i) {
        res *= (n - i);
        res%=m;
        res /= (i + 1);
    }

    return res%m;
}

ll big_mod(ll base, ll power, ll mod)
{
    if(power==0)    return 1;

    else if(power%2==1)
    {
        ll p1 = base % mod;
        ll p2 = (big_mod(base,power-1,mod))%mod;
        return (p1*p2)%mod;
    }
    else if(power%2==0)
    {
        ll p1 = (big_mod(base,power/2,mod))%mod;
        return (p1*p1)%mod;
    }
}
*/

 //mapl maap;
/*
 void dfs(ll x)
 {
     vis[x]=1;
     pos=x;
     for(ll i: v1[x])
     {
         pos=i;
         if(maap[i]==1)
         {
             pos=i;
             tata

         }
         if(vis[i]==0)
         {

             vis[i]=1;
             dfs(i);
         }
     }
 }
 */

/*vec v;
ll a[10000003];
ll is_prime(ll x)
{
    ll i;
    for(i=2;i*i<=x;i++)
    {
        if(x%i==0)
            return 0;
    }
    return 1;
}
void sieve()
{
    ll i,j;
    for(i=2;i*i<10000000;i++)
    {
        if(a[i]==0)
        {
            for(j=i*2;j<=10000000;j+=i)
                a[j]=1;
        }
    }
    for(i=2;i<=10000000;i++)
    {
        if(a[i]==0)
            v.pb(i);
    }

}
*/
vec v[100];
ll cost[100];
ll cnt=0;
ll vis[100];
void dfs(ll x)
{
    vis[x]=1;

    for(auto y:v[x])
    {
        if(vis[y]==0)
        {
          vis[y]=1;
            cnt++;
            dfs(y);
        }
    }

}

void oka()
{
    ll n,m,i,j,k;
    cin>>n>>m;
    ll cost[n+1];

    ll x,y;
    ll ans=0;
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        v[x].pb(y);
        v[y].pb(x);

    }
    for(i=1;i<=n;i++)
    {
        if(vis[i]==0)
        {
            dfs(i);
            ans=max(ans,cnt);
            cnt=0;
        }
    }
    if(ans==0)
    {
        cout<<1<<endl;
        tata
    }

        cout<<ans*2<<endl;

}

int main()
{

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    run
    ll t;
    t=1;

 // cin>>t;
  while(t--)
        oka();
}


#include<bits/stdc++.h>
using namespace std;

//defines...
#define ll long long
#define tata return;
#define pb push_back
#define mp make_pair
#define in insert
#define run ios_base::sync_with_stdio(false);cin.tie(NULL);
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define yes cout<<"Yes"<<endl;
#define no cout<<"No"<<endl;
#define vec vector<ll>
#define setl set<ll>
#define mapl map<ll,ll>
#define shunno cout<<0<<endl;
#define ek cout<<1<<endl;
#define pi 2*acos(0.0)
#define hobena cout<<-1<<endl;

//typedefs...
typedef pair<ll,ll>pll;

//const..
//const ll fx[]={0,1,0,-1};
//const ll fy[]={1,0,-1,0};
//const ll mod=1e9+7;
/*
ll ncr(ll n, ll k)
{
    ll res = 1;

    if (k > n - k)
        k = (n - k)%m;

    for (int i = 0; i < k; ++i) {
        res *= (n - i);
        res%=m;
        res /= (i + 1);
    }

    return res%m;
}

ll big_mod(ll base, ll power, ll mod)
{
    if(power==0)    return 1;

    else if(power%2==1)
    {
        ll p1 = base % mod;
        ll p2 = (big_mod(base,power-1,mod))%mod;
        return (p1*p2)%mod;
    }
    else if(power%2==0)
    {
        ll p1 = (big_mod(base,power/2,mod))%mod;
        return (p1*p1)%mod;
    }
}
*/

 //mapl maap;
/*
 void dfs(ll x)
 {
     vis[x]=1;
     pos=x;
     for(ll i: v1[x])
     {
         pos=i;
         if(maap[i]==1)
         {
             pos=i;
             tata

         }
         if(vis[i]==0)
         {

             vis[i]=1;
             dfs(i);
         }
     }
 }
 */

/*vec v;
ll a[10000003];
ll is_prime(ll x)
{
    ll i;
    for(i=2;i*i<=x;i++)
    {
        if(x%i==0)
            return 0;
    }
    return 1;
}
void sieve()
{
    ll i,j;
    for(i=2;i*i<10000000;i++)
    {
        if(a[i]==0)
        {
            for(j=i*2;j<=10000000;j+=i)
                a[j]=1;
        }
    }
    for(i=2;i<=10000000;i++)
    {
        if(a[i]==0)
            v.pb(i);
    }

}
*/
vec v[100];
ll cost[100];
ll cnt=0;
ll vis[100];
void dfs(ll x)
{
    vis[x]=1;

    for(auto y:v[x])
    {
        if(vis[y]==0)
        {
          vis[y]=1;
            cnt++;
            dfs(y);
        }
    }

}

void oka()
{
    ll n,m,i,j,k;
    cin>>n>>m;
    ll cost[n+1];

    ll x,y;
    ll ans=0;
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        v[x].pb(y);
        v[y].pb(x);

    }
    for(i=1;i<=n;i++)
    {
        if(vis[i]==0)
        {
            dfs(i);
            ans=max(ans,cnt);
            cnt=0;
        }
    }
    if(ans==0)
    {
        cout<<1<<endl;
        tata
    }

        cout<<(ll)pow(2,ans)<<endl;

}

int main()
{

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    run
    ll t;
    t=1;

 // cin>>t;
  while(t--)
        oka();
}


#include<bits/stdc++.h>
using namespace std;

//defines...
#define ll long long
#define tata return;
#define pb push_back
#define mp make_pair
#define in insert
#define run ios_base::sync_with_stdio(false);cin.tie(NULL);
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define yes cout<<"Yes"<<endl;
#define no cout<<"No"<<endl;
#define vec vector<ll>
#define setl set<ll>
#define mapl map<ll,ll>
#define shunno cout<<0<<endl;
#define ek cout<<1<<endl;
#define pi 2*acos(0.0)
#define hobena cout<<-1<<endl;

//typedefs...
typedef pair<ll,ll>pll;

//const..
//const ll fx[]={0,1,0,-1};
//const ll fy[]={1,0,-1,0};
//const ll mod=1e9+7;
/*
ll ncr(ll n, ll k)
{
    ll res = 1;

    if (k > n - k)
        k = (n - k)%m;

    for (int i = 0; i < k; ++i) {
        res *= (n - i);
        res%=m;
        res /= (i + 1);
    }

    return res%m;
}

ll big_mod(ll base, ll power, ll mod)
{
    if(power==0)    return 1;

    else if(power%2==1)
    {
        ll p1 = base % mod;
        ll p2 = (big_mod(base,power-1,mod))%mod;
        return (p1*p2)%mod;
    }
    else if(power%2==0)
    {
        ll p1 = (big_mod(base,power/2,mod))%mod;
        return (p1*p1)%mod;
    }
}
*/

 //mapl maap;
/*
 void dfs(ll x)
 {
     vis[x]=1;
     pos=x;
     for(ll i: v1[x])
     {
         pos=i;
         if(maap[i]==1)
         {
             pos=i;
             tata

         }
         if(vis[i]==0)
         {

             vis[i]=1;
             dfs(i);
         }
     }
 }
 */

/*vec v;
ll a[10000003];
ll is_prime(ll x)
{
    ll i;
    for(i=2;i*i<=x;i++)
    {
        if(x%i==0)
            return 0;
    }
    return 1;
}
void sieve()
{
    ll i,j;
    for(i=2;i*i<10000000;i++)
    {
        if(a[i]==0)
        {
            for(j=i*2;j<=10000000;j+=i)
                a[j]=1;
        }
    }
    for(i=2;i<=10000000;i++)
    {
        if(a[i]==0)
            v.pb(i);
    }

}
*/
vec v[100];
ll cost[100];
ll cnt=0;
ll vis[100];
void dfs(ll x)
{
    vis[x]=1;

    for(auto y:v[x])
    {
        if(vis[y]==0)
        {
          vis[y]=1;
            cnt++;
            dfs(y);
        }
    }

}

void oka()
{
    ll n,m,i,j,k;
    cin>>n>>m;
    ll cost[n+1];

    ll x,y;
    ll ans=0;
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        v[x].pb(y);
        v[y].pb(x);

    }
    for(i=1;i<=n;i++)
    {
        if(vis[i]==0)
        {
            dfs(i);
            ans+=cnt;
            cnt=0;
        }
    }
    if(ans==0)
    {
        cout<<1<<endl;
        tata
    }

        cout<<(ll)pow(2,ans)<<endl;

}

int main()
{

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    run
    ll t;
    t=1;

 // cin>>t;
  while(t--)
        oka();
}


#include<bits/stdc++.h>
using namespace std;

//defines...
#define ll long long
#define tata return;
#define pb push_back
#define mp make_pair
#define in insert
#define run ios_base::sync_with_stdio(false);cin.tie(NULL);
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define yes cout<<"Yes"<<endl;
#define no cout<<"No"<<endl;
#define vec vector<ll>
#define setl set<ll>
#define mapl map<ll,ll>
#define shunno cout<<0<<endl;
#define ek cout<<1<<endl;
#define pi 2*acos(0.0)
#define hobena cout<<-1<<endl;

//typedefs...
typedef pair<ll,ll>pll;

//const..
//const ll fx[]={0,1,0,-1};
//const ll fy[]={1,0,-1,0};
//const ll mod=1e9+7;
/*
ll ncr(ll n, ll k)
{
    ll res = 1;

    if (k > n - k)
        k = (n - k)%m;

    for (int i = 0; i < k; ++i) {
        res *= (n - i);
        res%=m;
        res /= (i + 1);
    }

    return res%m;
}

ll big_mod(ll base, ll power, ll mod)
{
    if(power==0)    return 1;

    else if(power%2==1)
    {
        ll p1 = base % mod;
        ll p2 = (big_mod(base,power-1,mod))%mod;
        return (p1*p2)%mod;
    }
    else if(power%2==0)
    {
        ll p1 = (big_mod(base,power/2,mod))%mod;
        return (p1*p1)%mod;
    }
}
*/

 //mapl maap;
/*
 void dfs(ll x)
 {
     vis[x]=1;
     pos=x;
     for(ll i: v1[x])
     {
         pos=i;
         if(maap[i]==1)
         {
             pos=i;
             tata

         }
         if(vis[i]==0)
         {

             vis[i]=1;
             dfs(i);
         }
     }
 }
 */

/*vec v;
ll a[10000003];
ll is_prime(ll x)
{
    ll i;
    for(i=2;i*i<=x;i++)
    {
        if(x%i==0)
            return 0;
    }
    return 1;
}
void sieve()
{
    ll i,j;
    for(i=2;i*i<10000000;i++)
    {
        if(a[i]==0)
        {
            for(j=i*2;j<=10000000;j+=i)
                a[j]=1;
        }
    }
    for(i=2;i<=10000000;i++)
    {
        if(a[i]==0)
            v.pb(i);
    }

}
*/
vec v[100];
ll cost[100];
ll cnt=0;
ll vis[100];
void dfs(ll x)
{
    vis[x]=1;
    cnt++;
    for(auto y:v[x])
    {
        if(vis[y]==0)
        {
            vis[y]=1;
            cnt++;
            dfs(y);
        }
    }

}

void oka()
{
    ll n,m,i,j,k;
    ll cost[n+1];

    ll x,y;
    ll ans=0;
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        v[x].pb(y);
        v[y].pb(x);

    }
    for(i=1;i<=n;i++)
    {
        if(vis[i]==0)
        {
            dfs(i);
            ans=max(ans,cnt);
            cnt=0;
        }
    }
    if(ans==1)
    {
        cout<<1<<endl;
    }
    else
        cout<<(ans-1)*2<<endl;

}

int main()
{

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    run
    ll t;
    t=1;

 // cin>>t;
  while(t--)
        oka();
}


#include<bits/stdc++.h>
using namespace std;

//defines...
#define ll long long
#define tata return;
#define pb push_back
#define mp make_pair
#define in insert
#define run ios_base::sync_with_stdio(false);cin.tie(NULL);
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define yes cout<<"Yes"<<endl;
#define no cout<<"No"<<endl;
#define vec vector<ll>
#define setl set<ll>
#define mapl map<ll,ll>
#define shunno cout<<0<<endl;
#define ek cout<<1<<endl;
#define pi 2*acos(0.0)
#define hobena cout<<-1<<endl;

//typedefs...
typedef pair<ll,ll>pll;

//const..
//const ll fx[]={0,1,0,-1};
//const ll fy[]={1,0,-1,0};
//const ll mod=1e9+7;
/*
ll ncr(ll n, ll k)
{
    ll res = 1;

    if (k > n - k)
        k = (n - k)%m;

    for (int i = 0; i < k; ++i) {
        res *= (n - i);
        res%=m;
        res /= (i + 1);
    }

    return res%m;
}

ll big_mod(ll base, ll power, ll mod)
{
    if(power==0)    return 1;

    else if(power%2==1)
    {
        ll p1 = base % mod;
        ll p2 = (big_mod(base,power-1,mod))%mod;
        return (p1*p2)%mod;
    }
    else if(power%2==0)
    {
        ll p1 = (big_mod(base,power/2,mod))%mod;
        return (p1*p1)%mod;
    }
}
*/

 //mapl maap;
/*
 void dfs(ll x)
 {
     vis[x]=1;
     pos=x;
     for(ll i: v1[x])
     {
         pos=i;
         if(maap[i]==1)
         {
             pos=i;
             tata

         }
         if(vis[i]==0)
         {

             vis[i]=1;
             dfs(i);
         }
     }
 }
 */

/*vec v;
ll a[10000003];
ll is_prime(ll x)
{
    ll i;
    for(i=2;i*i<=x;i++)
    {
        if(x%i==0)
            return 0;
    }
    return 1;
}
void sieve()
{
    ll i,j;
    for(i=2;i*i<10000000;i++)
    {
        if(a[i]==0)
        {
            for(j=i*2;j<=10000000;j+=i)
                a[j]=1;
        }
    }
    for(i=2;i<=10000000;i++)
    {
        if(a[i]==0)
            v.pb(i);
    }

}
*/
vec v[100];
ll cost[100];
ll cnt=0;
ll vis[100];
void dfs(ll x)
{
    vis[x]=1;

    for(auto y:v[x])
    {
        if(vis[y]==0)
        {
          vis[y]=1;
            cnt++;
            dfs(y);
        }
    }

}

void oka()
{
    ll n,m,i,j,k;
    cin>>n>>m;
    ll cost[n+1];

    ll x,y;
    ll ans=0;
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        v[x].pb(y);
        v[y].pb(x);

    }
    for(i=1;i<=n;i++)
    {
        if(vis[i]==0)
        {
            dfs(i);
            ans=max(ans,cnt);
            cnt=0;
        }
    }
    if(ans==1)
    {
        cout<<1<<endl;
    }
    else
        cout<<ans*2<<endl;

}

int main()
{

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    run
    ll t;
    t=1;

 // cin>>t;
  while(t--)
        oka();
}


    /*
     KUNAL RAUT (ZUKONIT14)  :- "DO WHAT YOU LIKE!"
     -PICT,PUNE! :)
     */
    #include<bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define ld long double
    #define pb push_back
    #define mp make_pair
    #define fi first
    #define se second
    #define mod 1000000007
    #define mod9 1000000009
    #define mod1 998244353
    #define pi 3.1415926535
    #define MAXN 1000001
    #define MAX2N 1*1000 + 10
    #define INF 2e18
    #define all(v) v.begin(), v.end()
    #define ms(s, n) memset(s, n, sizeof(s))
    #define prec(n) fixed<<setprecision(n)
    #define forci(p,n) for(ll i=p;i<(ll)n;i++)
    #define forcj(p,n) for(ll j=p;j<(ll)n;j++)
    #define bolt ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    #define bits(a) __builtin_popcount(a)
    #define test ll t;cin>>t;while(t--)
    ll zero=0;
    ll one=1;
    ll gcd(ll a,ll b){    if(b==0) return a;    return gcd(b,a%b);}
    ll lcm(ll a,ll b) {    return (a/gcd(a,b)*b);}
    ll expo(ll x, ll y) {ll res=1;x=x%mod;while(y>0){if(y&1)res=(1ll*res*x)%mod;
        y=y>>1;x=(1ll*x*x)%mod;} return res;}
    ll expo1(ll x, ll y) {ll res=1;x=x%mod1;while(y>0){if(y&1)res=(1ll*res*x)%mod1;
        y=y>>1;x=(1ll*x*x)%mod1;} return res;}
    ll ncr(ll n,ll r){ ll res=1; if(r>n-r)r=n-r; for(ll i=0;i<r;i++) {  res*=n-i;  res/=i+1; } return res;}
    ll max(ll a,ll b){return (a>b)?a:b;}
    bool prime(ll n){ll i;for(i=2;i<=sqrt(n);i++){if(n%i==0)return false;}return true;}
    bool sortbysec(const pair<ll,ll> &a,const pair<ll,ll> &b){return(a.second<b.second);}

    //https://www.youtube.com/watch?v=k4V3Mo61fJM

    vector<ll>g[MAXN];
    bool vis[MAXN];
    ll n,m,x,c,k;
    void dfs(ll x)
    {
    	k++;
    	vis[x]=1;
    	for(ll i=0;i<g[x].size();i++)
    		if(!vis[g[x][i]]) dfs(g[x][i]);
    }
    signed main()
    {
        bolt;
        cin>>n>>m;
        forci(0,m)
        {
        	ll u,v;cin>>u>>v;
        	g[u].pb(v);
        	g[v].pb(u);
        }
        c=0;ll ans=0;
        forci(1,n+1)
        {
        	if(!vis[i])
        	{
        		k=0;
        		dfs(i);
        		ans+=k-1;
        	}
        }
        cout<<int(pow(2,ans));
        return 0;
    }


    /*
     KUNAL RAUT (ZUKONIT14)  :- "DO WHAT YOU LIKE!"
     -PICT,PUNE! :)
     */
    #include<bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define ld long double
    #define pb push_back
    #define mp make_pair
    #define fi first
    #define se second
    #define mod 1000000007
    #define mod9 1000000009
    #define mod1 998244353
    #define pi 3.1415926535
    #define MAXN 1000001
    #define MAX2N 1*1000 + 10
    #define INF 2e18
    #define all(v) v.begin(), v.end()
    #define ms(s, n) memset(s, n, sizeof(s))
    #define prec(n) fixed<<setprecision(n)
    #define forci(p,n) for(ll i=p;i<(ll)n;i++)
    #define forcj(p,n) for(ll j=p;j<(ll)n;j++)
    #define bolt ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    #define bits(a) __builtin_popcount(a)
    #define test ll t;cin>>t;while(t--)
    ll zero=0;
    ll one=1;
    ll gcd(ll a,ll b){    if(b==0) return a;    return gcd(b,a%b);}
    ll lcm(ll a,ll b) {    return (a/gcd(a,b)*b);}
    ll expo(ll x, ll y) {ll res=1;x=x%mod;while(y>0){if(y&1)res=(1ll*res*x)%mod;
        y=y>>1;x=(1ll*x*x)%mod;} return res;}
    ll expo1(ll x, ll y) {ll res=1;x=x%mod1;while(y>0){if(y&1)res=(1ll*res*x)%mod1;
        y=y>>1;x=(1ll*x*x)%mod1;} return res;}
    ll ncr(ll n,ll r){ ll res=1; if(r>n-r)r=n-r; for(ll i=0;i<r;i++) {  res*=n-i;  res/=i+1; } return res;}
    ll max(ll a,ll b){return (a>b)?a:b;}
    bool prime(ll n){ll i;for(i=2;i<=sqrt(n);i++){if(n%i==0)return false;}return true;}
    bool sortbysec(const pair<ll,ll> &a,const pair<ll,ll> &b){return(a.second<b.second);}

    //https://www.youtube.com/watch?v=k4V3Mo61fJM

    vector<ll>g[MAXN];
    bool vis[MAXN];
    ll n,m,x,c,k;
    void dfs(ll x)
    {
    	k++;
    	vis[x]=1;
    	for(ll i=0;i<g[x].size();i++)
    		if(!vis[g[x][i]]) dfs(g[x][i]);
    }
    signed main()
    {
        bolt;
        cin>>n>>m;
        forci(0,m)
        {
        	ll u,v;cin>>u>>v;
        	g[u].pb(v);
        	g[v].pb(u);
        }
        c=0;ll ans=0;
        forci(1,n+1)
        {
        	if(!vis[i])
        	{
        		k=0;
        		dfs(i);
        		ans+=k-1;
        	}
        }
        cout<<(ll)pow(2,ans);
        return 0;
    }


    /*
     KUNAL RAUT (ZUKONIT14)  :- "DO WHAT YOU LIKE!"
     -PICT,PUNE! :)
     */
    #include<bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define ld long double
    #define pb push_back
    #define mp make_pair
    #define fi first
    #define se second
    #define mod 1000000007
    #define mod9 1000000009
    #define mod1 998244353
    #define pi 3.1415926535
    #define MAXN 1000001
    #define MAX2N 1*1000 + 10
    #define INF 2e18
    #define all(v) v.begin(), v.end()
    #define ms(s, n) memset(s, n, sizeof(s))
    #define prec(n) fixed<<setprecision(n)
    #define forci(p,n) for(ll i=p;i<(ll)n;i++)
    #define forcj(p,n) for(ll j=p;j<(ll)n;j++)
    #define bolt ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    #define bits(a) __builtin_popcount(a)
    #define test ll t;cin>>t;while(t--)
    ll zero=0;
    ll one=1;
    ll gcd(ll a,ll b){    if(b==0) return a;    return gcd(b,a%b);}
    ll lcm(ll a,ll b) {    return (a/gcd(a,b)*b);}
    ll expo(ll x, ll y) {ll res=1;x=x%mod;while(y>0){if(y&1)res=(1ll*res*x)%mod;
        y=y>>1;x=(1ll*x*x)%mod;} return res;}
    ll expo1(ll x, ll y) {ll res=1;x=x%mod1;while(y>0){if(y&1)res=(1ll*res*x)%mod1;
        y=y>>1;x=(1ll*x*x)%mod1;} return res;}
    ll ncr(ll n,ll r){ ll res=1; if(r>n-r)r=n-r; for(ll i=0;i<r;i++) {  res*=n-i;  res/=i+1; } return res;}
    ll max(ll a,ll b){return (a>b)?a:b;}
    bool prime(ll n){ll i;for(i=2;i<=sqrt(n);i++){if(n%i==0)return false;}return true;}
    bool sortbysec(const pair<ll,ll> &a,const pair<ll,ll> &b){return(a.second<b.second);}

    //https://www.youtube.com/watch?v=k4V3Mo61fJM

    vector<ll>g[MAXN];
    bool vis[MAXN];
    ll n,m,x,c;
    void dfs(ll x)
    {
    	vis[x]=1;
    	for(ll i=0;i<g[x].size();i++)
    		if(!vis[g[x][i]]) dfs(g[x][i]);
    }
    signed main()
    {
        bolt;
        cin>>n>>m;
        forci(0,m)
        {
        	ll u,v;cin>>u>>v;
        	g[u].pb(v);
        	g[v].pb(u);
        }
        forci(1,n+1)
        {
        	if(!vis[i])
        	{
        		dfs(i);
        		c++;
        	}
        }
        cout<<expo(2,n-c);
        return 0;
    }


    /*
     KUNAL RAUT (ZUKONIT14)  :- "DO WHAT YOU LIKE!"
     -PICT,PUNE! :)
     */
    #include<bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define ld long double
    #define pb push_back
    #define mp make_pair
    #define fi first
    #define se second
    #define mod 1000000007
    #define mod9 1000000009
    #define mod1 998244353
    #define pi 3.1415926535
    #define MAXN 1000001
    #define MAX2N 1*1000 + 10
    #define INF 2e18
    #define all(v) v.begin(), v.end()
    #define ms(s, n) memset(s, n, sizeof(s))
    #define prec(n) fixed<<setprecision(n)
    #define forci(p,n) for(ll i=p;i<(ll)n;i++)
    #define forcj(p,n) for(ll j=p;j<(ll)n;j++)
    #define bolt ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    #define bits(a) __builtin_popcount(a)
    #define test ll t;cin>>t;while(t--)
    ll zero=0;
    ll one=1;
    ll gcd(ll a,ll b){    if(b==0) return a;    return gcd(b,a%b);}
    ll lcm(ll a,ll b) {    return (a/gcd(a,b)*b);}
    ll expo(ll x, ll y) {ll res=1;x=x%mod;while(y>0){if(y&1)res=(1ll*res*x)%mod;
        y=y>>1;x=(1ll*x*x)%mod;} return res;}
    ll expo1(ll x, ll y) {ll res=1;x=x%mod1;while(y>0){if(y&1)res=(1ll*res*x)%mod1;
        y=y>>1;x=(1ll*x*x)%mod1;} return res;}
    ll ncr(ll n,ll r){ ll res=1; if(r>n-r)r=n-r; for(ll i=0;i<r;i++) {  res*=n-i;  res/=i+1; } return res;}
    ll max(ll a,ll b){return (a>b)?a:b;}
    bool prime(ll n){ll i;for(i=2;i<=sqrt(n);i++){if(n%i==0)return false;}return true;}
    bool sortbysec(const pair<ll,ll> &a,const pair<ll,ll> &b){return(a.second<b.second);}

    //https://www.youtube.com/watch?v=k4V3Mo61fJM

    vector<ll>g[MAXN];
    bool vis[MAXN];
    ll n,m,x,c,k;
    void dfs(ll x)
    {
    	k++;
    	vis[x]=1;
    	for(ll i=0;i<g[x].size();i++)
    		if(!vis[g[x][i]]) dfs(g[x][i]);
    }
    signed main()
    {
        bolt;
        cin>>n>>m;
        forci(0,m)
        {
        	ll u,v;cin>>u>>v;
        	g[u].pb(v);
        	g[v].pb(u);
        }
        c=0;ll ans=0;
        forci(1,n+1)
        {
        	if(!vis[i])
        	{
        		k=0;
        		dfs(i);
        		ans+=k-1;
        	}
        }
        cout<<pow(2,ans);
        return 0;
    }


    /*
     KUNAL RAUT (ZUKONIT14)  :- "DO WHAT YOU LIKE!"
     -PICT,PUNE! :)
     */
    #include<bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define ld long double
    #define pb push_back
    #define mp make_pair
    #define fi first
    #define se second
    #define mod 1000000007
    #define mod9 1000000009
    #define mod1 998244353
    #define pi 3.1415926535
    #define MAXN 1000001
    #define MAX2N 1*1000 + 10
    #define INF 2e18
    #define all(v) v.begin(), v.end()
    #define ms(s, n) memset(s, n, sizeof(s))
    #define prec(n) fixed<<setprecision(n)
    #define forci(p,n) for(ll i=p;i<(ll)n;i++)
    #define forcj(p,n) for(ll j=p;j<(ll)n;j++)
    #define bolt ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    #define bits(a) __builtin_popcount(a)
    #define test ll t;cin>>t;while(t--)
    ll zero=0;
    ll one=1;
    ll gcd(ll a,ll b){    if(b==0) return a;    return gcd(b,a%b);}
    ll lcm(ll a,ll b) {    return (a/gcd(a,b)*b);}
    ll expo(ll x, ll y) {ll res=1;x=x%mod;while(y>0){if(y&1)res=(1ll*res*x)%mod;
        y=y>>1;x=(1ll*x*x)%mod;} return res;}
    ll expo1(ll x, ll y) {ll res=1;x=x%mod1;while(y>0){if(y&1)res=(1ll*res*x)%mod1;
        y=y>>1;x=(1ll*x*x)%mod1;} return res;}
    ll ncr(ll n,ll r){ ll res=1; if(r>n-r)r=n-r; for(ll i=0;i<r;i++) {  res*=n-i;  res/=i+1; } return res;}
    ll max(ll a,ll b){return (a>b)?a:b;}
    bool prime(ll n){ll i;for(i=2;i<=sqrt(n);i++){if(n%i==0)return false;}return true;}
    bool sortbysec(const pair<ll,ll> &a,const pair<ll,ll> &b){return(a.second<b.second);}

    //https://www.youtube.com/watch?v=k4V3Mo61fJM

    vector<ll>g[MAXN];
    bool vis[MAXN];
    ll n,m,x,c,k;
    void dfs(ll x)
    {
    	k++;
    	vis[x]=1;
    	for(ll i=0;i<g[x].size();i++)
    		if(!vis[g[x][i]]) dfs(g[x][i]);
    }
    signed main()
    {
        bolt;
        cin>>n>>m;
        forci(0,m)
        {
        	ll u,v;cin>>u>>v;
        	g[u].pb(v);
        	g[v].pb(u);
        }
        c=0;ll ans=0;
        forci(1,n+1)
        {
        	if(!vis[i])
        	{
        		k=0;
        		dfs(i);
        		ans+=k-1;
        	}
        }
        cout<<expo(2,ans);
        return 0;
    }


#include <bits/stdc++.h>
#define INF 1000000007
using namespace std;

int main(){
	int t =1 ;
	//cin >> t;
	while(t--){
		int n,m ;
		cin>>n>>m ;
		vector<int> adj[n+1] ;
		for(int i=0 ;i<m ;i++){
			int x,y ;
			cin>>x>>y;
			adj[x].push_back(y) ;
			adj[y].push_back(x) ;
		}
		int ans=1 ;
		unordered_set<int> visited ;
		queue<int> q ;
		for(int i=1 ;i<=n ;i++){
			if(visited.count(i)>0) continue ;
			q.push(i);
			while(!q.empty()){
				int temp=q.front();
				q.pop() ;
				visited.insert(temp) ;
				for(auto x:adj[temp]){
					if(visited.count(x)>0) continue ;
					ans*=2 ;
					q.push(x) ;
				}
			}
		}
		cout<<ans<<endl ;

	}
	return 0 ;

}


#include <bits/stdc++.h>
#define INF 1000000007
using namespace std;

int main(){
	int t =1 ;
	//cin >> t;
	while(t--){
		int n,m ;
		cin>>n>>m ;
		vector<int> adj[n+1] ;
		for(int i=0 ;i<m ;i++){
			int x,y ;
			cin>>x>>y;
			adj[x].push_back(y) ;
			adj[y].push_back(x) ;
		}
		double ans=1 ;
		unordered_set<int> visited ;
		queue<int> q ;
		for(int i=1 ;i<=n ;i++){
			if(visited.count(i)>0) continue ;
			q.push(i);
			ans/=2 ;
			while(!q.empty()){
				int temp=q.front();
				q.pop() ;
				if(visited.count(temp)>0) continue ;
				ans*=2 ;
				visited.insert(temp) ;
				for(auto x:adj[temp]){
					q.push(x) ;
				}
			}
		}
		cout<<ans<<endl ;

	}
	return 0 ;

}


#include <bits/stdc++.h>
#define INF 1000000007
using namespace std;

int main(){
	int t =1 ;
	//cin >> t;
	while(t--){
		int n,m ;
		cin>>n>>m ;
		vector<int> adj[n+1] ;
		for(int i=0 ;i<m ;i++){
			int x,y ;
			cin>>x>>y;
			adj[x].push_back(y) ;
			adj[y].push_back(x) ;
		}
		long double ans=1 ;
		unordered_set<int> visited ;
		queue<int> q ;
		for(int i=1 ;i<=n ;i++){
			if(visited.count(i)>0) continue ;
			q.push(i);
			ans/=2 ;
			while(!q.empty()){
				int temp=q.front();
				q.pop() ;
				if(visited.count(temp)>0) continue ;
				ans*=2 ;
				visited.insert(temp) ;
				for(auto x:adj[temp]){
					q.push(x) ;
				}
			}
		}
		cout<<to_string((ans))<<endl ;

	}
	return 0 ;

}


#include <bits/stdc++.h>
#define INF 1000000007
using namespace std;

int main(){
	int t =1 ;
	//cin >> t;
	while(t--){
		int n,m ;
		cin>>n>>m ;
		vector<int> adj[n+1] ;
		for(int i=0 ;i<m ;i++){
			int x,y ;
			cin>>x>>y;
			adj[x].push_back(y) ;
			adj[y].push_back(x) ;
		}
		long double ans=1 ;
		unordered_set<int> visited ;
		queue<int> q ;
		for(int i=1 ;i<=n ;i++){
			if(visited.count(i)>0) continue ;
			q.push(i);
			ans/=2 ;
			while(!q.empty()){
				int temp=q.front();
				q.pop() ;
				if(visited.count(temp)>0) continue ;
				ans*=2 ;
				visited.insert(temp) ;
				for(auto x:adj[temp]){
					q.push(x) ;
				}
			}
		}
		cout<<to_string(long(ans))<<endl ;

	}
	return 0 ;

}


#include <bits/stdc++.h>
#define INF 1000000007
using namespace std;

int main(){
	int t =1 ;
	//cin >> t;
	while(t--){
		int n,m ;
		cin>>n>>m ;
		vector<int> adj[n+1] ;
		for(int i=0 ;i<m ;i++){
			int x,y ;
			cin>>x>>y;
			adj[x].push_back(y) ;
			adj[y].push_back(x) ;
		}
		long double ans=1 ;
		unordered_set<int> visited ;
		queue<int> q ;
		for(int i=1 ;i<=n ;i++){
			if(visited.count(i)>0) continue ;
			q.push(i);
			ans/=2 ;
			while(!q.empty()){
				int temp=q.front();
				q.pop() ;
				if(visited.count(temp)>0) continue ;
				ans*=2 ;
				visited.insert(temp) ;
				for(auto x:adj[temp]){
					q.push(x) ;
				}
			}
		}
		cout<<to_string((long long)ans)<<endl ;

	}
	return 0 ;

}


#include <bits/stdc++.h>

using namespace std;

int n, m;

vector <vector <int> > adj;

vector <bool> used;

int cntnode = 0;

void dfs (int v) {
	used[v] = true;
	cntnode ++;
	for (int to : adj[v]) {
		if (!used[to]) {
			dfs(to);
		}
	}
}

int main() {

	cin >> n >> m;
	adj.resize(n + 1);
	used.assign(n + 1, false);
	while (m -- ) {
		int x, y;
		cin >> x >> y;
		adj[x].push_back(y);
		adj[y].push_back(x);
	}
	int k = 0;
	for (int i = 1; i <= n; i ++) {
		if (!used[i]) {
			cntnode = 0;
			dfs(i);
			k = max(k, cntnode);
		}
	}
	long long ans = 1LL * (1 << (1LL * k - 1));
	cout << ans << '\n';
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m;

vector <vector <int> > adj;

vector <bool> used;

long long cntnode = 0;

void dfs (int v) {
	used[v] = true;
	cntnode ++;
	for (int to : adj[v]) {
		if (!used[to]) {
			dfs(to);
		}
	}
}

int main() {

	cin >> n >> m;
	adj.resize(n + 1);
	used.assign(n + 1, false);
	while (m -- ) {
		int x, y;
		cin >> x >> y;
		adj[x].push_back(y);
		adj[y].push_back(x);
	}
	long long ans = 1;
	for (int i = 1; i <= n; i ++) {
		if (!used[i]) {
			cntnode = 0;
			dfs(i);
			cntnode --;
			ans *= (1LL << cntnode);
		}
	}
	cout << ans << '\n';
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m;

vector <vector <int> > adj;

vector <bool> used;

int cntnode = 0;

void dfs (int v) {
	used[v] = true;
	cntnode ++;
	for (int to : adj[v]) {
		if (!used[to]) {
			dfs(to);
		}
	}
}

int main() {

	cin >> n >> m;
	adj.resize(n + 1);
	used.assign(n + 1, false);
	while (m -- ) {
		int x, y;
		cin >> x >> y;
		adj[x].push_back(y);
		adj[y].push_back(x);
	}
	long long ans = 0;
	for (int i = 1; i <= n; i ++) {
		if (!used[i]) {
			cntnode = 0;
			dfs(i);
			ans += 1LL * (1 << (cntnode - 1));
		}
	}
	cout << ans << '\n';
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m;

vector <vector <int> > adj;

vector <bool> used;

int cntnode = 0;

void dfs (int v) {
	used[v] = true;
	cntnode ++;
	for (int to : adj[v]) {
		if (!used[to]) {
			dfs(to);
		}
	}
}

int main() {

	cin >> n >> m;
	adj.resize(n + 1);
	used.assign(n + 1, false);
	while (m -- ) {
		int x, y;
		cin >> x >> y;
		adj[x].push_back(y);
		adj[y].push_back(x);
	}
	long long ans = 1;
	for (int i = 1; i <= n; i ++) {
		if (!used[i]) {
			cntnode = 0;
			dfs(i);
			ans *= 1LL * (1 << (cntnode - 1));
		}
	}
	cout << ans << '\n';
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m;

vector <vector <int> > adj;

vector <bool> used;

int cntnode = 0;

void dfs (int v) {
	used[v] = true;
	cntnode ++;
	for (int to : adj[v]) {
		if (!used[to]) {
			dfs(to);
		}
	}
}

int main() {

	cin >> n >> m;
	adj.resize(n + 1);
	used.assign(n + 1, false);
	while (m -- ) {
		int x, y;
		cin >> x >> y;
		adj[x].push_back(y);
		adj[y].push_back(x);
	}
	long long ans = 1;
	for (int i = 1; i <= n; i ++) {
		if (!used[i]) {
			cntnode = 0;
			dfs(i);
			ans *= (1 << (cntnode - 1));
		}
	}
	cout << ans << '\n';
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m;

vector <vector <int> > adj;

vector <bool> used;

int cntnode = 0;

void dfs (int v) {
	used[v] = true;
	cntnode ++;
	for (int to : adj[v]) {
		if (!used[to]) {
			dfs(to);
		}
	}
}

int main() {

	cin >> n >> m;
	adj.resize(n + 1);
	used.assign(n + 1, false);
	while (m -- ) {
		int x, y;
		cin >> x >> y;
		adj[x].push_back(y);
		adj[y].push_back(x);
	}
	long long ans = 1;
	for (int i = 1; i <= n; i ++) {
		if (!used[i]) {
			cntnode = 0;
			dfs(i);
			ans += 1LL * (1 << (cntnode - 1));
		}
	}
	cout << ans << '\n';
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m;

vector <vector <int> > adj;

vector <bool> used;

int cntnode = 0;

void dfs (int v) {
	used[v] = true;
	cntnode ++;
	for (int to : adj[v]) {
		if (!used[to]) {
			dfs(to);
		}
	}
}

int main() {

	cin >> n >> m;
	adj.resize(n + 1);
	used.assign(n + 1, false);
	while (m -- ) {
		int x, y;
		cin >> x >> y;
		adj[x].push_back(y);
		adj[y].push_back(x);
	}
	int k = 0;
	for (int i = 1; i <= n; i ++) {
		if (!used[i]) {
			cntnode = 0;
			dfs(i);
			k = max(k, cntnode);
		}
	}
	long long ans = 1LL * (1 << (k - 1));
	cout << ans << '\n';
	return 0;
}


#include<iostream>
#include<vector>
#include<map>
// #include<cmath>
// #include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef map<int,vi> mp;
typedef vector<vi> vvi;
// #define ppp(arr) for(auto it=arr.begin(); it!=arr.end(); ++it)cout<<*it<<"  ";
long long int power(int a,int b){
    if(b==1)
        return a;
    if(b==0)
        return 1;
    else
        {
            if(b%2==0)
                return power(a,b/2)*power(a,b/2);
            else
                return power(a,b/2)*power(a,b/2+1);
        }
}
#define max(a,b) (a>b?a:b);
int dfs(mp &graph,int *visited,int v,vi &paired,int &maxl){
    // cout<<v;
    if(visited[v]!=1){
        // cout<<v<<endl;
        visited[v]=1;
        paired.push_back(v);
        maxl*=2;
        // cout<<v<<endl;
        for(auto it=graph[v].begin(); it!=graph[v].end(); ++it){
            if(!visited[*it]){
                dfs(graph,visited,*it,paired,maxl);
            }
        }
        return 1;
    }
    return 1;

}

long long int transclosure(int n,mp &graph){
    // vi visited(n+10,0);
    int visited[n+1];
    for(int i=0; i<=n; i++)
        visited[i]=0;
    // cout<<visited.size()<<endl;
    vvi closure;
    int sol=1;
    for(auto it=graph.begin(); it!=graph.end(); ++it){
        if(visited[it->first]==0){
            vi paired;
            int maxl=1;
            dfs(graph,visited,it->first,paired,maxl);
            // cout<<maxl<<"MAXL"<<endl;
            sol*=(maxl/2);
            maxl=1;
            closure.push_back(paired);

        }
    }
    // cout<<"*******************************************"<<endl;
    // for(auto it=closure.begin(); it!=closure.end(); ++it){
    //     for(auto itt=(*it).begin(); itt!=(*it).end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<"************************************"<<endl;
    // // ppp(visited);
    // cout<<endl<<visited[30]<<"Booyah"<<endl;
    return max(sol,1);

    // int maxl=1;
    // for(auto it=closure.begin(); it!=closure.end(); ++it){
    // //    if((*it).size()>=maxl)
    // //    {
    //        maxl*=(int)pow(2.0,(*it).size()-1);
    // //    }
    // }
    // return max(maxl,1);

}

int main(){
    int n,m;
    int a,b;
    cin>>n>>m;
    mp graph;
    for(int i=0; i<m; i++){
        cin>>a>>b;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    // cout<<endl<<"The graph************************"<<endl;
    // for(auto it=graph.begin(); it!=graph.end(); ++it){
    //     cout<<it->first<<"--->";
    //     for(auto itt=graph[it->first].begin(); itt!=graph[it->first].end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<"The graph end";
    // cout<<endl<<endl;
    // for(auto it=graph[1].begin(); it!=graph[1].end(); ++it)
    // cout<<*it<<"   ";
    long long int sol=transclosure(n,graph);
    cout<<sol<<endl;
    // cout<<endl;
    // cout<<5/2+1;
}


#include<iostream>
#include<vector>
#include<map>
// #include<cmath>
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef map<int,vi> mp;
typedef vector<vi> vvi;
// #define ppp(arr) for(auto it=arr.begin(); it!=arr.end(); ++it)cout<<*it<<"  ";
#define max(a,b) (a>b?a:b);
int dfs(mp &graph,vi &visited,int v,vi &paired){
    // cout<<v;
    if(visited[v]!=1){
        visited[v]=1;
        paired.push_back(v);
        // cout<<v<<endl;
        for(auto it=graph[v].begin(); it!=graph[v].end(); ++it){
            if(!visited[*it]){
                dfs(graph,visited,*it,paired);
            }
        }
        return 1;
    }
    return 1;

}

int transclosure(mp &graph){
    vi visited(graph.size()+2,0);
    vvi closure;
    for(auto it=graph.begin(); it!=graph.end(); ++it){
        if(visited[it->first]==0){
            vi paired;
            dfs(graph,visited,it->first,paired);
            closure.push_back(paired);

        }
    }
    // cout<<"*******************************************"<<endl;
    // for(auto it=closure.begin(); it!=closure.end(); ++it){
    //     for(auto itt=(*it).begin(); itt!=(*it).end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<"************************************"<<endl;
    int maxl=1;
    for(auto it=closure.begin(); it!=closure.end(); ++it){
    //    if((*it).size()>=maxl)
    //    {
           maxl*=(int)pow(2.0,(*it).size()-1);
    //    }
    }
    return max(maxl,1);

}

int main(){
    int n,m;
    int a,b;
    cin>>n>>m;
    mp graph;
    for(int i=0; i<m; i++){
        cin>>a>>b;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    // for(auto it=graph.begin(); it!=graph.end(); ++it){
    //     for(auto itt=graph[it->first].begin(); itt!=graph[it->first].end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<endl<<endl;
    // for(auto it=graph[1].begin(); it!=graph[1].end(); ++it)
    // cout<<*it<<"   ";
    cout<<transclosure(graph)<<endl;
}


#include<iostream>
#include<vector>
#include<map>
// #include<cmath>
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef map<int,vi> mp;
typedef vector<vi> vvi;
// #define ppp(arr) for(auto it=arr.begin(); it!=arr.end(); ++it)cout<<*it<<"  ";
long long int power(int a,int b){
    if(b==1)
        return a;
    if(b==0)
        return 1;
    else
        {
            if(b%2==0)
                return power(a,b/2)*power(a,b/2);
            else
                return power(a,b/2)*power(a,b/2+1);
        }
}
#define max(a,b) (a>b?a:b);
int dfs(mp &graph,vi &visited,int v,vi &paired,int &maxl){
    // cout<<v;
    if(visited[v]!=1){
        visited[v]=1;
        paired.push_back(v);
        maxl*=2;
        // cout<<v<<endl;
        for(auto it=graph[v].begin(); it!=graph[v].end(); ++it){
            if(!visited[*it]){
                dfs(graph,visited,*it,paired,maxl);
            }
        }
        return 1;
    }
    return 1;

}

long long int transclosure(mp &graph){
    vi visited(graph.size()+2,0);
    vvi closure;
    int sol=1;
    for(auto it=graph.begin(); it!=graph.end(); ++it){
        if(visited[it->first]==0){
            vi paired;
            int maxl=1;
            dfs(graph,visited,it->first,paired,maxl);
            // cout<<maxl<<"MAXL"<<endl;
            sol*=(maxl/2);
            maxl=1;
            closure.push_back(paired);

        }
    }
    return max(sol,1);
    // cout<<"*******************************************"<<endl;
    // for(auto it=closure.begin(); it!=closure.end(); ++it){
    //     for(auto itt=(*it).begin(); itt!=(*it).end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<"************************************"<<endl;
    // int maxl=1;
    // for(auto it=closure.begin(); it!=closure.end(); ++it){
    // //    if((*it).size()>=maxl)
    // //    {
    //        maxl*=(int)pow(2.0,(*it).size()-1);
    // //    }
    // }
    // return max(maxl,1);

}

int main(){
    int n,m;
    int a,b;
    cin>>n>>m;
    mp graph;
    for(int i=0; i<m; i++){
        cin>>a>>b;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    // for(auto it=graph.begin(); it!=graph.end(); ++it){
    //     for(auto itt=graph[it->first].begin(); itt!=graph[it->first].end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<endl<<endl;
    // for(auto it=graph[1].begin(); it!=graph[1].end(); ++it)
    // cout<<*it<<"   ";
    cout<<transclosure(graph)<<endl;
    // cout<<endl;
    // cout<<5/2+1;
}


#include<iostream>
#include<vector>
#include<map>
#include<cmath>
using namespace std;
typedef vector<int> vi;
typedef map<int,vi> mp;
typedef vector<vi> vvi;
// #define ppp(arr) for(auto it=arr.begin(); it!=arr.end(); ++it)cout<<*it<<"  ";
#define max(a,b) (a>b?a:b);
int dfs(mp &graph,vi &visited,int v,vi &paired){
    // cout<<v;
    if(visited[v]!=1){
        visited[v]=1;
        paired.push_back(v);
        // cout<<v<<endl;
        for(auto it=graph[v].begin(); it!=graph[v].end(); ++it){
            if(!visited[*it]){
                dfs(graph,visited,*it,paired);
            }
        }
        return 1;
    }
    return 1;

}

int transclosure(mp &graph){
    vi visited(graph.size()+2,0);
    vvi closure;
    for(auto it=graph.begin(); it!=graph.end(); ++it){
        if(visited[it->first]==0){
            vi paired;
            dfs(graph,visited,it->first,paired);
            closure.push_back(paired);

        }
    }
    // cout<<"*******************************************"<<endl;
    // for(auto it=closure.begin(); it!=closure.end(); ++it){
    //     for(auto itt=(*it).begin(); itt!=(*it).end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<"************************************"<<endl;
    int maxl=1;
    for(auto it=closure.begin(); it!=closure.end(); ++it){
    //    if((*it).size()>=maxl)
    //    {
           maxl*=(int)pow(2,(*it).size()-1);
    //    }
    }
    return max(maxl,1);

}

int main(){
    int n,m;
    int a,b;
    cin>>n>>m;
    mp graph;
    for(int i=0; i<m; i++){
        cin>>a>>b;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    // for(auto it=graph.begin(); it!=graph.end(); ++it){
    //     for(auto itt=graph[it->first].begin(); itt!=graph[it->first].end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<endl<<endl;
    // for(auto it=graph[1].begin(); it!=graph[1].end(); ++it)
    // cout<<*it<<"   ";
    cout<<transclosure(graph)<<endl;
}


#include<iostream>
#include<vector>
#include<map>
#include<cmath>
using namespace std;
typedef vector<int> vi;
typedef map<int,vi> mp;
typedef vector<vi> vvi;
// #define ppp(arr) for(auto it=arr.begin(); it!=arr.end(); ++it)cout<<*it<<"  ";
#define max(a,b) (a>b?a:b);
int dfs(mp &graph,vi &visited,int v,vi &paired){
    // cout<<v;
    if(visited[v]!=1){
        visited[v]=1;
        paired.push_back(v);
        // cout<<v<<endl;
        for(auto it=graph[v].begin(); it!=graph[v].end(); ++it){
            if(!visited[*it]){
                dfs(graph,visited,*it,paired);
            }
        }
        return 1;
    }
    return 1;

}

int transclosure(mp &graph){
    vi visited(graph.size()+2,0);
    vvi closure;
    for(auto it=graph.begin(); it!=graph.end(); ++it){
        if(visited[it->first]==0){
            vi paired;
            dfs(graph,visited,it->first,paired);
            closure.push_back(paired);

        }
    }
    // cout<<"*******************************************"<<endl;
    // for(auto it=closure.begin(); it!=closure.end(); ++it){
    //     for(auto itt=(*it).begin(); itt!=(*it).end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<"************************************"<<endl;
    int maxl=1;
    for(auto it=closure.begin(); it!=closure.end(); ++it){
    //    if((*it).size()>=maxl)
    //    {
           maxl*=pow(2,(*it).size()-1);
    //    }
    }
    return max(maxl,1);

}

int main(){
    int n,m;
    int a,b;
    cin>>n>>m;
    mp graph;
    for(int i=0; i<m; i++){
        cin>>a>>b;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    // for(auto it=graph.begin(); it!=graph.end(); ++it){
    //     for(auto itt=graph[it->first].begin(); itt!=graph[it->first].end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<endl<<endl;
    // for(auto it=graph[1].begin(); it!=graph[1].end(); ++it)
    // cout<<*it<<"   ";
    cout<<transclosure(graph)<<endl;
}


#include<iostream>
#include<vector>
#include<map>
// #include<cmath>
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef map<int,vi> mp;
typedef vector<vi> vvi;
// #define ppp(arr) for(auto it=arr.begin(); it!=arr.end(); ++it)cout<<*it<<"  ";
long long int power(int a,int b){
    if(b==1)
        return a;
    if(b==0)
        return 1;
    else
        {
            if(b%2==0)
                return power(a,b/2)*power(a,b/2);
            else
                return power(a,b/2)*power(a,b/2+1);
        }
}
#define max(a,b) (a>b?a:b);
int dfs(mp &graph,vi &visited,int v,vi &paired,int &maxl){
    // cout<<v;
    if(visited[v]!=1){
        visited[v]=1;
        paired.push_back(v);
        maxl*=2;
        // cout<<v<<endl;
        for(auto it=graph[v].begin(); it!=graph[v].end(); ++it){
            if(!visited[*it]){
                dfs(graph,visited,*it,paired,maxl);
            }
        }
        return 1;
    }
    return 1;

}

long long int transclosure(mp &graph){
    vi visited(graph.size()+2,0);
    vvi closure;
    int sol=1;
    for(auto it=graph.begin(); it!=graph.end(); ++it){
        if(visited[it->first]==0){
            vi paired;
            int maxl=1;
            dfs(graph,visited,it->first,paired,maxl);
            // cout<<maxl<<"MAXL"<<endl;
            sol*=(maxl/2);
            maxl=1;
            closure.push_back(paired);

        }
    }
    return max(sol,1);
    // cout<<"*******************************************"<<endl;
    // for(auto it=closure.begin(); it!=closure.end(); ++it){
    //     for(auto itt=(*it).begin(); itt!=(*it).end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<"************************************"<<endl;
    // int maxl=1;
    // for(auto it=closure.begin(); it!=closure.end(); ++it){
    // //    if((*it).size()>=maxl)
    // //    {
    //        maxl*=(int)pow(2.0,(*it).size()-1);
    // //    }
    // }
    // return max(maxl,1);

}

int main(){
    int n,m;
    int a,b;
    cin>>n>>m;
    mp graph;
    for(int i=0; i<m; i++){
        cin>>a>>b;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    // for(auto it=graph.begin(); it!=graph.end(); ++it){
    //     for(auto itt=graph[it->first].begin(); itt!=graph[it->first].end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<endl<<endl;
    // for(auto it=graph[1].begin(); it!=graph[1].end(); ++it)
    // cout<<*it<<"   ";
    long long int sol=transclosure(graph);
    cout<<sol<<endl;
    // cout<<endl;
    // cout<<5/2+1;
}


#include<iostream>
#include<vector>
#include<map>
// #include<cmath>
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef map<int,vi> mp;
typedef vector<vi> vvi;
// #define ppp(arr) for(auto it=arr.begin(); it!=arr.end(); ++it)cout<<*it<<"  ";
#define max(a,b) (a>b?a:b);
int dfs(mp &graph,vi &visited,int v,vi &paired){
    // cout<<v;
    if(visited[v]!=1){
        visited[v]=1;
        paired.push_back(v);
        // cout<<v<<endl;
        for(auto it=graph[v].begin(); it!=graph[v].end(); ++it){
            if(!visited[*it]){
                dfs(graph,visited,*it,paired);
            }
        }
        return 1;
    }
    return 1;

}

int transclosure(mp &graph){
    vi visited(graph.size()+2,0);
    vvi closure;
    for(auto it=graph.begin(); it!=graph.end(); ++it){
        if(visited[it->first]==0){
            vi paired;
            dfs(graph,visited,it->first,paired);
            closure.push_back(paired);

        }
    }
    // cout<<"*******************************************"<<endl;
    // for(auto it=closure.begin(); it!=closure.end(); ++it){
    //     for(auto itt=(*it).begin(); itt!=(*it).end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<"************************************"<<endl;
    int maxl=1;
    for(auto it=closure.begin(); it!=closure.end(); ++it){
    //    if((*it).size()>=maxl)
    //    {
           maxl*=(int)pow(2,(*it).size()-1);
    //    }
    }
    return max(maxl,1);

}

int main(){
    int n,m;
    int a,b;
    cin>>n>>m;
    mp graph;
    for(int i=0; i<m; i++){
        cin>>a>>b;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    // for(auto it=graph.begin(); it!=graph.end(); ++it){
    //     for(auto itt=graph[it->first].begin(); itt!=graph[it->first].end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<endl<<endl;
    // for(auto it=graph[1].begin(); it!=graph[1].end(); ++it)
    // cout<<*it<<"   ";
    cout<<transclosure(graph)<<endl;
}


#include<iostream>
#include<vector>
#include<map>
// #include<cmath>
// #include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef map<int,vi> mp;
typedef vector<vi> vvi;
// #define ppp(arr) for(auto it=arr.begin(); it!=arr.end(); ++it)cout<<*it<<"  ";
long long int power(int a,int b){
    if(b==1)
        return a;
    if(b==0)
        return 1;
    else
        {
            if(b%2==0)
                return power(a,b/2)*power(a,b/2);
            else
                return power(a,b/2)*power(a,b/2+1);
        }
}
#define max(a,b) (a>b?a:b);
int dfs(mp &graph,int *visited,int v,vi &paired,long long int &maxl){
    // cout<<v;
    if(visited[v]!=1){
        // cout<<v<<endl;
        visited[v]=1;
        paired.push_back(v);
        maxl*=2;
        // cout<<maxl<<endl;
        // cout<<v<<endl;
        for(auto it=graph[v].begin(); it!=graph[v].end(); ++it){
            if(!visited[*it]){
                dfs(graph,visited,*it,paired,maxl);
            }
        }
        return 1;
    }
    return 1;

}

long long int transclosure(int n,mp &graph){
    // vi visited(n+10,0);
    int visited[n+1];
    for(int i=0; i<=n; i++)
        visited[i]=0;
    // cout<<visited.size()<<endl;
    vvi closure;
    long long int sol=1;
    for(auto it=graph.begin(); it!=graph.end(); ++it){
        if(visited[it->first]==0){
            vi paired;
            long long int maxl=1;
            dfs(graph,visited,it->first,paired,maxl);
            // cout<<maxl<<"MAXL"<<endl;
            sol*=(maxl/2);
            maxl=1;
            closure.push_back(paired);

        }
    }
    // cout<<"*******************************************"<<endl;
    // for(auto it=closure.begin(); it!=closure.end(); ++it){
    //     for(auto itt=(*it).begin(); itt!=(*it).end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<"************************************"<<endl;
    // // ppp(visited);
    // cout<<endl<<visited[30]<<"Booyah"<<endl;
    // cout<<sol<<endl;
    return max(sol,1);

    // int maxl=1;
    // for(auto it=closure.begin(); it!=closure.end(); ++it){
    // //    if((*it).size()>=maxl)
    // //    {
    //        maxl*=(int)pow(2.0,(*it).size()-1);
    // //    }
    // }
    // return max(maxl,1);

}

int main(){
    int n,m;
    int a,b;
    cin>>n>>m;
    mp graph;
    for(int i=0; i<m; i++){
        cin>>a>>b;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    // cout<<endl<<"The graph************************"<<endl;
    // for(auto it=graph.begin(); it!=graph.end(); ++it){
    //     cout<<it->first<<"--->";
    //     for(auto itt=graph[it->first].begin(); itt!=graph[it->first].end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<"The graph end";
    // cout<<endl<<endl;
    // for(auto it=graph[1].begin(); it!=graph[1].end(); ++it)
    // cout<<*it<<"   ";
    long long int sol=transclosure(n,graph);
    cout<<sol<<endl;
    // cout<<endl;
    // cout<<5/2+1;
}


#include<iostream>
#include<vector>
#include<map>
// #include<cmath>
// #include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef map<int,vi> mp;
typedef vector<vi> vvi;
// #define ppp(arr) for(auto it=arr.begin(); it!=arr.end(); ++it)cout<<*it<<"  ";
long long int power(int a,int b){
    if(b==1)
        return a;
    if(b==0)
        return 1;
    else
        {
            if(b%2==0)
                return power(a,b/2)*power(a,b/2);
            else
                return power(a,b/2)*power(a,b/2+1);
        }
}
#define max(a,b) (a>b?a:b);
int dfs(mp &graph,vi &visited,int v,vi &paired,int &maxl){
    // cout<<v;
    if(visited[v]!=1){
        visited[v]=1;
        paired.push_back(v);
        maxl*=2;
        // cout<<v<<endl;
        for(auto it=graph[v].begin(); it!=graph[v].end(); ++it){
            if(!visited[*it]){
                dfs(graph,visited,*it,paired,maxl);
            }
        }
        return 1;
    }
    return 1;

}

long long int transclosure(mp &graph){
    vi visited(graph.size()+2,0);
    vvi closure;
    int sol=1;
    for(auto it=graph.begin(); it!=graph.end(); ++it){
        if(visited[it->first]==0){
            vi paired;
            int maxl=1;
            dfs(graph,visited,it->first,paired,maxl);
            // cout<<maxl<<"MAXL"<<endl;
            sol*=(maxl/2);
            maxl=1;
            closure.push_back(paired);

        }
    }
    return max(sol,1);
    // cout<<"*******************************************"<<endl;
    // for(auto it=closure.begin(); it!=closure.end(); ++it){
    //     for(auto itt=(*it).begin(); itt!=(*it).end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<"************************************"<<endl;
    // int maxl=1;
    // for(auto it=closure.begin(); it!=closure.end(); ++it){
    // //    if((*it).size()>=maxl)
    // //    {
    //        maxl*=(int)pow(2.0,(*it).size()-1);
    // //    }
    // }
    // return max(maxl,1);

}

int main(){
    int n,m;
    int a,b;
    cin>>n>>m;
    mp graph;
    for(int i=0; i<m; i++){
        cin>>a>>b;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    // for(auto it=graph.begin(); it!=graph.end(); ++it){
    //     for(auto itt=graph[it->first].begin(); itt!=graph[it->first].end(); ++itt)
    //         cout<<*itt<<"  ";
    //     cout<<endl;
    // }
    // cout<<endl<<endl;
    // for(auto it=graph[1].begin(); it!=graph[1].end(); ++it)
    // cout<<*it<<"   ";
    long long int sol=transclosure(graph);
    cout<<sol<<endl;
    // cout<<endl;
    // cout<<5/2+1;
}


#include "bits/stdc++.h"

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double dd;
#define all(v) v.begin(),v.end()
#define all(v) v.begin(),v.end()
#define endl "\n"
#define clr(n, r) memset(n,r,sizeof(n))
typedef bitset<10> MASK;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<ll> vi;
typedef pair<int, int> pi;
typedef vector<vector<ll>> vvi;

void fast() {

    cin.tie(0);
    cin.sync_with_stdio(0);
}

const int MAX = 55;

struct DSU {
    int parent[MAX];
    int groupSize[MAX];
    int rank[MAX];
    int CC;

    DSU() {
        CC = MAX;
        for (int i = 1; i < MAX; ++i) {
            parent[i] = i;
            groupSize[i] = 1;
        }
    }
    int findLeader(int node) {
        if (parent[node] == node)return node;
        return parent[node] = findLeader(parent[node]);
    }

    int sameGroup(int i, int j) {
        return findLeader(i) == findLeader(j);
    }

    int mergeGroup(int i, int j) {
        int leader1 = findLeader(i);
        int leader2 = findLeader(j);
        if (leader1 == leader2)return 0;
        CC--;
        if (groupSize[leader1] > groupSize[leader2]) {
            parent[leader2] = leader1;
            groupSize[leader1] += groupSize[leader2];
        } else {
            parent[leader1] = leader2;
            groupSize[leader2] += groupSize[leader1];

        }
        return 1;
    }

    void mergeGroupByRank(int i, int j) {
        int leader1 = findLeader(i);
        int leader2 = findLeader(j);
        if (leader1 == leader2)return;
        if (rank[leader1] < rank[leader2])swap(leader1, leader2);
        parent[leader2] = leader1;
        if (rank[leader1] == rank[leader2])rank[leader1]++;
        CC--;
    }

    int getCC() {
        return CC;
    }

    int getSize(int node) {
        return groupSize[findLeader(node)];
    }

};

int main() {
    fast();
    DSU d;
    int n,m;cin>>n>>m;
    while(m--){
        int a,b;cin>>a>>b;
        d.mergeGroup(a,b);
    }
    ll mxg=1;
    for (int i = 1; i <=n ; ++i) {
        mxg=max(mxg,(ll)d.getSize(i));
    }
    cout<<powl(2ll,mxg-1ll);

}


#include "bits/stdc++.h"

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double dd;
#define all(v) v.begin(),v.end()
#define all(v) v.begin(),v.end()
#define endl "\n"
#define clr(n, r) memset(n,r,sizeof(n))
typedef bitset<10> MASK;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<ll> vi;
typedef pair<int, int> pi;
typedef vector<vector<ll>> vvi;

void fast() {

    cin.tie(0);
    cin.sync_with_stdio(0);
}

const int MAX = 51;

struct DSU {
    int parent[MAX];
    int groupSize[MAX];
    int rank[MAX];
    int CC;

    DSU() {
        CC = MAX;
        for (int i = 0; i < MAX; ++i) {
            parent[i] = i;
            groupSize[i] = 1;
        }
    }
    int findLeader(int node) {
        if (parent[node] == node)return node;
        return parent[node] = findLeader(parent[node]);
    }

    int sameGroup(int i, int j) {
        return findLeader(i) == findLeader(j);
    }

    int mergeGroup(int i, int j) {
        int leader1 = findLeader(i);
        int leader2 = findLeader(j);
        if (leader1 == leader2)return 0;
        CC--;
        if (groupSize[leader1] > groupSize[leader2]) {
            parent[leader2] = leader1;
            groupSize[leader1] += groupSize[leader2];
        } else {
            parent[leader1] = leader2;
            groupSize[leader2] += groupSize[leader1];

        }
        return 1;
    }

    void mergeGroupByRank(int i, int j) {
        int leader1 = findLeader(i);
        int leader2 = findLeader(j);
        if (leader1 == leader2)return;
        if (rank[leader1] < rank[leader2])swap(leader1, leader2);
        parent[leader2] = leader1;
        if (rank[leader1] == rank[leader2])rank[leader1]++;
        CC--;
    }

    int getCC() {
        return CC;
    }

    int getSize(int node) {
        return groupSize[findLeader(node)];
    }

};

int main() {
    fast();
    DSU d;
    int n,m;cin>>n>>m;
    while(m--){
        int a,b;cin>>a>>b;
        d.mergeGroup(a,b);
    }
    ll mxg=1;
    for (int i = 1; i <=n ; ++i) {
        mxg=max(mxg,(ll)d.getSize(i));
    }
    cout<<powl(2ll,mxg-1);

}


#include "bits/stdc++.h"

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double dd;
#define all(v) v.begin(),v.end()
#define all(v) v.begin(),v.end()
#define endl "\n"
#define clr(n, r) memset(n,r,sizeof(n))
typedef bitset<10> MASK;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<ll> vi;
typedef pair<int, int> pi;
typedef vector<vector<ll>> vvi;

void fast() {

    cin.tie(0);
    cin.sync_with_stdio(0);
}

const int MAX = 51;

struct DSU {
    int parent[MAX];
    int groupSize[MAX];
    int rank[MAX];
    int CC;

    DSU() {
        CC = MAX;
        for (int i = 0; i < MAX; ++i) {
            parent[i] = i;
            groupSize[i] = 1;
        }
    }
    int findLeader(int node) {
        if (parent[node] == node)return node;
        return parent[node] = findLeader(parent[node]);
    }

    int sameGroup(int i, int j) {
        return findLeader(i) == findLeader(j);
    }

    int mergeGroup(int i, int j) {
        int leader1 = findLeader(i);
        int leader2 = findLeader(j);
        if (leader1 == leader2)return 0;
        CC--;
        if (groupSize[leader1] > groupSize[leader2]) {
            parent[leader2] = leader1;
            groupSize[leader1] += groupSize[leader2];
        } else {
            parent[leader1] = leader2;
            groupSize[leader2] += groupSize[leader1];

        }
        return 1;
    }

    void mergeGroupByRank(int i, int j) {
        int leader1 = findLeader(i);
        int leader2 = findLeader(j);
        if (leader1 == leader2)return;
        if (rank[leader1] < rank[leader2])swap(leader1, leader2);
        parent[leader2] = leader1;
        if (rank[leader1] == rank[leader2])rank[leader1]++;
        CC--;
    }

    int getCC() {
        return CC;
    }

    int getSize(int node) {
        return groupSize[findLeader(node)];
    }

};

int main() {
    fast();
    DSU d;
    int n,m;cin>>n>>m;
    while(m--){
        int a,b;cin>>a>>b;
        d.mergeGroup(a,b);
    }
    ll mxg=1;
    for (int i = 1; i <=n ; ++i) {
        mxg=max(mxg,(ll)d.getSize(i));
    }
    cout<<powl(2ll,mxg-1ll);

}


#include "bits/stdc++.h"

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double dd;
#define all(v) v.begin(),v.end()
#define all(v) v.begin(),v.end()
#define endl "\n"
#define clr(n, r) memset(n,r,sizeof(n))
typedef bitset<10> MASK;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<ll> vi;
typedef pair<int, int> pi;
typedef vector<vector<ll>> vvi;

void fast() {

    cin.tie(0);
    cin.sync_with_stdio(0);
}

const int MAX = 55;

struct DSU {
    int parent[MAX];
    int groupSize[MAX];
    int rank[MAX];
    int CC;

    DSU() {
        CC = MAX;
        for (int i = 1; i <= MAX; ++i) {
            parent[i] = i;
            groupSize[i] = 1;
        }
    }
    int findLeader(int node) {
        if (parent[node] == node)return node;
        return parent[node] = findLeader(parent[node]);
    }

    int sameGroup(int i, int j) {
        return findLeader(i) == findLeader(j);
    }

    int mergeGroup(int i, int j) {
        int leader1 = findLeader(i);
        int leader2 = findLeader(j);
        if (leader1 == leader2)return 0;
        CC--;
        if (groupSize[leader1] > groupSize[leader2]) {
            parent[leader2] = leader1;
            groupSize[leader1] += groupSize[leader2];
        } else {
            parent[leader1] = leader2;
            groupSize[leader2] += groupSize[leader1];

        }
        return 1;
    }

    void mergeGroupByRank(int i, int j) {
        int leader1 = findLeader(i);
        int leader2 = findLeader(j);
        if (leader1 == leader2)return;
        if (rank[leader1] < rank[leader2])swap(leader1, leader2);
        parent[leader2] = leader1;
        if (rank[leader1] == rank[leader2])rank[leader1]++;
        CC--;
    }

    int getCC() {
        return CC;
    }

    int getSize(int node) {
        return groupSize[findLeader(node)];
    }

};

int main() {
    fast();
    DSU d;
    int n,m;cin>>n>>m;
    while(m--){
        int a,b;cin>>a>>b;
        d.mergeGroup(a,b);
    }
    ll mxg=1;
    for (int i = 1; i <=n ; ++i) {
        mxg=max(mxg,(ll)d.getSize(i));
    }
    cout<<powl(2ll,mxg-1ll);

}


#include "bits/stdc++.h"

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double dd;
#define all(v) v.begin(),v.end()
#define all(v) v.begin(),v.end()
#define endl "\n"
#define clr(n, r) memset(n,r,sizeof(n))
typedef bitset<10> MASK;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<ll> vi;
typedef pair<int, int> pi;
typedef vector<vector<ll>> vvi;

void fast() {

    cin.tie(0);
    cin.sync_with_stdio(0);
}

const int MAX = 51;

struct DSU {
    int parent[MAX];
    int groupSize[MAX];
    int rank[MAX];
    int CC;

    DSU() {
        CC = MAX;
        for (int i = 1; i <= MAX; ++i) {
            parent[i] = i;
            groupSize[i] = 1;
        }
    }
    int findLeader(int node) {
        if (parent[node] == node)return node;
        return parent[node] = findLeader(parent[node]);
    }

    int sameGroup(int i, int j) {
        return findLeader(i) == findLeader(j);
    }

    int mergeGroup(int i, int j) {
        int leader1 = findLeader(i);
        int leader2 = findLeader(j);
        if (leader1 == leader2)return 0;
        CC--;
        if (groupSize[leader1] > groupSize[leader2]) {
            parent[leader2] = leader1;
            groupSize[leader1] += groupSize[leader2];
        } else {
            parent[leader1] = leader2;
            groupSize[leader2] += groupSize[leader1];

        }
        return 1;
    }

    void mergeGroupByRank(int i, int j) {
        int leader1 = findLeader(i);
        int leader2 = findLeader(j);
        if (leader1 == leader2)return;
        if (rank[leader1] < rank[leader2])swap(leader1, leader2);
        parent[leader2] = leader1;
        if (rank[leader1] == rank[leader2])rank[leader1]++;
        CC--;
    }

    int getCC() {
        return CC;
    }

    int getSize(int node) {
        return groupSize[findLeader(node)];
    }

};

int main() {
    fast();
    DSU d;
    int n,m;cin>>n>>m;
    while(m--){
        int a,b;cin>>a>>b;
        d.mergeGroup(a,b);
    }
    ll mxg=1;
    for (int i = 1; i <=n ; ++i) {
        mxg=max(mxg,(ll)d.getSize(i));
    }
    cout<<powl(2ll,mxg-1ll);

}


#include "bits/stdc++.h"

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double dd;
#define all(v) v.begin(),v.end()
#define all(v) v.begin(),v.end()
#define endl "\n"
#define clr(n, r) memset(n,r,sizeof(n))
typedef bitset<10> MASK;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<ll> vi;
typedef pair<int, int> pi;
typedef vector<vector<ll>> vvi;

void fast() {

    cin.tie(0);
    cin.sync_with_stdio(0);
}

const int MAX = 55;

struct DSU {
    int parent[MAX];
    int groupSize[MAX];
    int rank[MAX];
    int CC;

    DSU() {
        CC = MAX;
        for (int i = 1; i < MAX; ++i) {
            parent[i] = i;
            groupSize[i] = 1;
        }
    }
    int findLeader(int node) {
        if (parent[node] == node)return node;
        return parent[node] = findLeader(parent[node]);
    }

    int sameGroup(int i, int j) {
        return findLeader(i) == findLeader(j);
    }

    int mergeGroup(int i, int j) {
        int leader1 = findLeader(i);
        int leader2 = findLeader(j);
        if (leader1 == leader2)return 0;
        CC--;
        if (groupSize[leader1] > groupSize[leader2]) {
            parent[leader2] = leader1;
            groupSize[leader1] += groupSize[leader2];
        } else {
            parent[leader1] = leader2;
            groupSize[leader2] += groupSize[leader1];

        }
        return 1;
    }

    void mergeGroupByRank(int i, int j) {
        int leader1 = findLeader(i);
        int leader2 = findLeader(j);
        if (leader1 == leader2)return;
        if (rank[leader1] < rank[leader2])swap(leader1, leader2);
        parent[leader2] = leader1;
        if (rank[leader1] == rank[leader2])rank[leader1]++;
        CC--;
    }

    int getCC() {
        return CC;
    }

    int getSize(int node) {
        return groupSize[findLeader(node)];
    }

};

int main() {
    fast();
    DSU d;
    int n,m;cin>>n>>m;
    d.CC=n;
    while(m--){
        int a,b;cin>>a>>b;
        d.mergeGroup(a,b);
    }
    ll mxg=n;
    for (int i = 1; i <=n ; ++i) {
        mxg-=(d.getSize(i)==1);
        d.CC-=d.getSize(i)==1;
    }
//    cout<<d.getCC()<<" ";
    cout<<(1ll<<(mxg-d.getCC()));

}


#include<bits/stdc++.h>
using namespace std;

int n,m,x,y,c=0;
vector<vector<int> > v;
bool vis[101];

void dfs(int node){
	vis[node] = 1;
	for(int i=0;i<v[node].size();i++){
		int child = v[node][i];
		if(!vis[child]){
			c++;
			dfs(child);
		}
	}

}

int main(){
    cin>>n>>m;
    v = vector<vector<int> > (n+1);
    for(int i=0;i<m;i++){
    	cin>>x>>y;
    	v[x].push_back(y);
    	v[y].push_back(x);
	}

   	for(int i=1;i<=n;i++){
   		if(!vis[i]){
   			dfs(i);
   		}
	}
	cout<<pow(2,c);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,m,x,y,c=0;
    cin>>n>>m;
    vector<vector<int> > v(n+1);
    for(int i=0;i<m;i++){
    	cin>>x>>y;
    	v[x].push_back(y);
    	v[y].push_back(x);
	}
    if(m == 0 && n > 0){
    	cout<<n;
    	return 0;
	}
   	for(int i=1;i<=n;i++){
   		for(int j=0;j<v[i].size();j++){
   			c++;
		}
	}
	cout<<c;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,m,x,y,c=0;
    cin>>n>>m;
    vector<int> v[10000];
    for(int i=0;i<m;i++){
    	cin>>x>>y;
    	v[x].push_back(y);
    	v[y].push_back(x);
	}
    if(m == 0 && n > 0){
    	cout<<n;
    	return 0;
	}
   	for(int i=1;i<=n;i++){
   		for(int j=0;j<v[i].size();j++){
   			c++;
		}
	}
	cout<<c;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,m,x,y,c=1;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        cin>>x>>y;
        c *= max(x,y);
    }
    cout<<c;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

long long n,m,x,y,c=0;
vector<vector<int> > v;
bool vis[101];

void dfs(int node){

	vis[node] = 1;
	for(int i=0;i<v[node].size();i++){
		int child = v[node][i];
		if(!vis[child]){
			c++;
			dfs(child);
		}
	}

}

int main(){
    cin>>n>>m;
    v = vector<vector<int> > (n+1);
    for(int i=0;i<m;i++){
    	cin>>x>>y;
    	v[x].push_back(y);
    	v[y].push_back(x);
	}

   	for(int i=1;i<=n;i++){
   		if(!vis[i]){
   			dfs(i);
   		}
	}
	x=1;
	for(int i=1;i<=c;i++){
		x *= 2;
	}
	cout<<x;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int n,m,x,y,c=0;
vector<vector<int> > v;
vector<bool> vis;

void dfs(int node){
	vis[node] = 1;
	for(int i=0;i<v[node].size();i++){
		int child = v[node][i];
		if(!vis[child]){
			c++;
			dfs(child);
		}
	}
}

int main(){
    cin>>n>>m;
    vis = vector<int> (n+1);
    v = vector<vector<int> > (n+1);
    for(int i=0;i<m;i++){
    	cin>>x>>y;
    	v[x].push_back(y);
    	v[y].push_back(x);
	}
	x=0;
   	for(int i=1;i<=n;i++){
   		dfs(i);
   		x = max(c,x);
   		c=0;
	}
	cout<<pow(2,x);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,m,x,y;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        cin>>x>>y;
    }
    cout<<2*m;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int n,m,x,y,c=0;
vector<vector<int> > v;
vector<bool> vis;

void dfs(int node){
	vis[node] = 1;
	for(int i=0;i<v[node].size();i++){
		int child = v[node][i];
		if(!vis[child]){
			c++;
			dfs(child);
		}
	}
}

int main(){
    cin>>n>>m;
    vis = vector<bool> (n+1);
    v = vector<vector<int> > (n+1);
    for(int i=0;i<m;i++){
    	cin>>x>>y;
    	v[x].push_back(y);
    	v[y].push_back(x);
	}
	x=0;
   	for(int i=1;i<=n;i++){
   		dfs(i);
   		x = max(c,x);
   		c=0;
	}
	cout<<pow(2,x);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,m,x,y,c=0;
    cin>>n>>m;
    vector<vector<int> > v(1000);
    for(int i=0;i<m;i++){
    	cin>>x>>y;
    	v[x].push_back(y);
    	v[y].push_back(x);
	}
    if(m == 0 && n > 0){
    	cout<<n;
    	return 0;
	}
   	for(int i=1;i<=n;i++){
   		for(int j=0;j<v[i].size();j++){
   			c++;
		}
	}
	cout<<c;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

/// Defining variable types.
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef double dl;

/// Defining usable key words
#define endl '\n'
#define PB push_back
#define F first
#define S second
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define sz(x) (int)x.size()
#define mem(a,b) memset(a, b, sizeof(a) )
#define sqr(a) ((a) * (a))

/// Defining constant variables.
const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007

/// Defining some useful lines.
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

/// Code of debugger.
#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)
void faltu ()
{
    cerr << endl;
}
template < typename T, typename ... hello>void faltu( T arg, const hello &... rest)
{
    cerr << arg << ' ';
    faltu(rest...);
}

const ll mx=1e5+123;
vector<ll>adj[mx];
bool vis[mx];
ll cnt=0;
ll ans=0;

void dfs(ll u)
{
    vis[u]=1;

    for(auto v:adj[u])
    {
        if(vis[v]==0)
        {
            dfs(v);

        }
    }
}

int main()
{
    optimize();

   ll m,n;

    cin>>n>>m;

    for(ll i=1; i<=m; i++)
    {
        ll a,b;
        cin>>a>>b;

        adj[a].PB(b);
        adj[b].PB(a);

    }

    for(ll i=1; i<=n; i++)
    {
        if(vis[i]==0)
        {
            dfs(i);
            cnt++;

        }

    }

    ll x= n-cnt;

    cout<<pow(2.0,x);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

/// Defining variable types.
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef double dl;

/// Defining usable key words
#define endl '\n'
#define PB push_back
#define F first
#define S second
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define sz(x) (int)x.size()
#define mem(a,b) memset(a, b, sizeof(a) )
#define sqr(a) ((a) * (a))

/// Defining constant variables.
const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007

/// Defining some useful lines.
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

/// Code of debugger.
#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)
void faltu ()
{
    cerr << endl;
}
template < typename T, typename ... hello>void faltu( T arg, const hello &... rest)
{
    cerr << arg << ' ';
    faltu(rest...);
}

const ll mx=1e5+123;
vector<ll>adj[mx];
bool vis[mx];
ll cnt=0;
ll ans=1;

void dfs(ll u)
{
    vis[u]=1;

    for(auto v:adj[u])
    {
        if(vis[v]==0)
        {
            dfs(v);

        }
    }
}

int main()
{
    optimize();

   ll m,n;

    cin>>n>>m;

    for(ll i=1; i<=m; i++)
    {
        ll a,b;
        cin>>a>>b;

        adj[a].PB(b);
        adj[b].PB(a);

    }

    for(ll i=1; i<=n; i++)
    {
        if(vis[i]==0)
        {
            dfs(i);
            cnt++;

        }

    }

    ll x= n-cnt;

    for(ll i=1;i<=x;i++)
    {
        ans=ans*2;
    }

    cout<<ans<<endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

/// Defining variable types.
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef double dl;

/// Defining usable key words
#define endl '\n'
#define PB push_back
#define F first
#define S second
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define sz(x) (int)x.size()
#define mem(a,b) memset(a, b, sizeof(a) )
#define sqr(a) ((a) * (a))

/// Defining constant variables.
const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007

/// Defining some useful lines.
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

/// Code of debugger.
#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)
void faltu ()
{
    cerr << endl;
}
template < typename T, typename ... hello>void faltu( T arg, const hello &... rest)
{
    cerr << arg << ' ';
    faltu(rest...);
}

const ll mx=1e5+123;
vector<ll>adj[mx];
bool vis[mx];
ll cnt=0;
ll ans=0;

void dfs(ll u)
{
    vis[u]=1;

    for(auto v:adj[u])
    {
        if(vis[v]==0)
        {
            dfs(v);

        }
    }
}

int main()
{
    optimize();

   ll m,n;

    cin>>n>>m;

    for(ll i=1; i<=m; i++)
    {
        ll a,b;
        cin>>a>>b;

        adj[a].PB(b);
        adj[b].PB(a);

    }

    for(ll i=1; i<=n; i++)
    {
        if(vis[i]==0)
        {
            dfs(i);
            cnt++;

        }

    }

    ll x= n-cnt;

    cout<<pow(2.0,(double)x);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

/// Defining variable types.
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef double dl;

/// Defining usable key words
#define endl '\n'
#define PB push_back
#define F first
#define S second
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define sz(x) (int)x.size()
#define mem(a,b) memset(a, b, sizeof(a) )
#define sqr(a) ((a) * (a))

/// Defining constant variables.
const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007

/// Defining some useful lines.
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

/// Code of debugger.
#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)
void faltu ()
{
    cerr << endl;
}
template < typename T, typename ... hello>void faltu( T arg, const hello &... rest)
{
    cerr << arg << ' ';
    faltu(rest...);
}

const int mx=1e5+123;
vector<int>adj[mx];
bool vis[mx];
int cnt=0;
int ans=0;

void dfs(int u)
{
    vis[u]=1;

    for(auto v:adj[u])
    {
        if(vis[v]==0)
        {
            dfs(v);

        }
    }
}

int main()
{
    optimize();

    int m,n;

    cin>>n>>m;

    for(int i=1; i<=m; i++)
    {
        int a,b;
        cin>>a>>b;

        adj[a].PB(b);
        adj[b].PB(a);

    }

    for(int i=1; i<=n; i++)
    {
        if(vis[i]==0)
        {
            dfs(i);
            cnt++;

        }

    }

    int x= n-cnt;

    cout<<pow(2,x);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

/// Defining variable types.
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef double dl;

/// Defining usable key words
#define endl '\n'
#define PB push_back
#define F first
#define S second
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define sz(x) (int)x.size()
#define mem(a,b) memset(a, b, sizeof(a) )
#define sqr(a) ((a) * (a))

/// Defining constant variables.
const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007

/// Defining some useful lines.
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

/// Code of debugger.
#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)
void faltu ()
{
    cerr << endl;
}
template < typename T, typename ... hello>void faltu( T arg, const hello &... rest)
{
    cerr << arg << ' ';
    faltu(rest...);
}

const ll mx=1e5+123;
vector<ll>adj[mx];
bool vis[mx];
ll cnt=0;
ll ans=0;

void dfs(ll u)
{
    vis[u]=1;

    for(auto v:adj[u])
    {
        if(vis[v]==0)
        {
            dfs(v);

        }
    }
}

int main()
{
    optimize();

   ll m,n;

    cin>>n>>m;

    for(ll i=1; i<=m; i++)
    {
        ll a,b;
        cin>>a>>b;

        adj[a].PB(b);
        adj[b].PB(a);

    }

    for(ll i=1; i<=n; i++)
    {
        if(vis[i]==0)
        {
            dfs(i);
            cnt++;

        }

    }

    ll x= n-cnt;

    cout<<pow(2,x);

    return 0;
}


#include <iostream>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <iomanip>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <utility>
using namespace std;
int ky[8] = {-1,1,-2,2,-2,2,-1,1};
int kx[8] = {-2,-2,-1,-1,1,1,2,2};
int dy[4] = {-1,0,1,0};
int dx[4] = {0,1,0,-1};
typedef long long ll;
#define pi pair
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define rep1(i,a,b) for(int i = a; i < b; i++)
#define rep2(i,a,b) for(int i = a; i <= b; i++)
#define INF 999999999999
int n,m;
bool adj[51][51];
vector<int> v;
int a[51];
pi<int,int> p[51];
ll ans;
int x,y;

bool ok(){
    int ns = v.size();
    int st = v[ns - 1]; // 추가된 원소

    rep1(i,0,ns - 1) // 벡터에 저장된 원소 개수 만큼
        if(adj[v[i]][st] || adj[st][v[i]]) return true;
    return false;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> m;
    rep1(i,0,m){
        cin >> x >> y;
        adj[x][y] = adj[y][x] = true; // 무방향
    }

    rep2(i,1,n){ // 1부터 n까지의 정점
        int cnt = 0;
        rep2(j,1,n) // 연결된 정점
            if(adj[i][j]) cnt++;
        p[i].first = cnt;
        p[i].second = i;
       // a[i] = cnt; // 1부터 시작
    }

    sort(p + 1, p + n + 1); // 내림 차순
    reverse(p + 1, p + n + 1);
    ans = 1;
    rep2(i,1,n){
      //  cout << p[i].second << ' ';
        v.push_back(p[i].second);
        if(v.size() > 1)
            if(ok()) ans *= 2;
    }
    cout << ans;
    return 0;
}


#include <iostream>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <iomanip>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <utility>
using namespace std;
int ky[8] = {-1,1,-2,2,-2,2,-1,1};
int kx[8] = {-2,-2,-1,-1,1,1,2,2};
int dy[4] = {-1,0,1,0};
int dx[4] = {0,1,0,-1};
typedef long long ll;
#define pi pair
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define rep1(i,a,b) for(int i = a; i < b; i++)
#define rep2(i,a,b) for(int i = a; i <= b; i++)
#define INF 999999999999
int n,m;
bool adj[51][51];
vector<int> v;
int a[51];
pi<int,int> p[51];
int ans;
int x,y;

bool ok(){
    int ns = v.size();
    int st = v[ns - 1]; // 추가된 원소

    rep1(i,0,ns - 1) // 벡터에 저장된 원소 개수 만큼
        if(adj[v[i]][st] || adj[st][v[i]]) return true;
    return false;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> m;
    rep1(i,0,m){
        cin >> x >> y;
        adj[x][y] = adj[y][x] = true; // 무방향
    }

    rep2(i,1,n){ // 1부터 n까지의 정점
        int cnt = 0;
        rep2(j,1,n) // 연결된 정점
            if(adj[i][j]) cnt++;
        p[i].first = cnt;
        p[i].second = i;
       // a[i] = cnt; // 1부터 시작
    }

    sort(p + 1, p + n + 1); // 내림 차순
    reverse(p + 1, p + n + 1);
    ans = 1;
    rep2(i,1,n){
      //  cout << p[i].second << ' ';
        v.push_back(p[i].second);
        if(v.size() > 1)
            if(ok()) ans *= 2;
    }
    cout << ans;
    return 0;
}


#include <iostream>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <iomanip>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <utility>
using namespace std;
int ky[8] = {-1,1,-2,2,-2,2,-1,1};
int kx[8] = {-2,-2,-1,-1,1,1,2,2};
int dy[4] = {-1,0,1,0};
int dx[4] = {0,1,0,-1};
int ddy[8] = {-1,0,1,-1,1,-1,0,1};
int ddx[8] = {-1,-1,-1,0,0,1,1,1};
typedef long long ll;
#define pi pair
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define rep1(i,a,b) for(int i = a; i < b; i++)
#define rep2(i,a,b) for(int i = a; i <= b; i++)
#define INF 999999999999
int n,m;
ll ans;
int x,y;
vector<int> adj[51];
bool visited[51];

void dfs(int here){
    if(visited[here]) return;
    visited[here] = true;
    ans *= 2;
    for(int i = 0; i < adj[here].size(); i++){
        int next = adj[here][i];
        dfs(next);
    }
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    cin >> n >> m;
    rep1(i,0,m){
        cin >> x >> y;
        adj[x].PB(y);
        adj[y].PB(x);
    }
    ans = 1;
    rep2(i,1,n) dfs(i);
    cout << ans / 2;
    return 0;
}


#include <iostream>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <iomanip>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <utility>
using namespace std;
int ky[8] = {-1,1,-2,2,-2,2,-1,1};
int kx[8] = {-2,-2,-1,-1,1,1,2,2};
int dy[4] = {-1,0,1,0};
int dx[4] = {0,1,0,-1};
int ddy[8] = {-1,0,1,-1,1,-1,0,1};
int ddx[8] = {-1,-1,-1,0,0,1,1,1};
typedef long long ll;
#define pi pair
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define rep1(i,a,b) for(int i = a; i < b; i++)
#define rep2(i,a,b) for(int i = a; i <= b; i++)
#define LB lower_bound
#define UP upper_bound
#define INF 999999999999
const double PI = acos(-1.0);
int n,m;
vector<int> adj[51];
bool vis[51];
ll ans;
ll cnt;

void dfs(int here){
    if(vis[here]) return;
    vis[here] = true;
    cnt++;
    if(cnt > 1) ans *= 2;
    rep1(i,0,(int)adj[here].size()){
        int next = adj[here][i];
        dfs(next);
    }
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w".stdout);
    cin >> n >> m; ans = 1;

    rep1(i,0,m){
        int u,v;
        cin >> u >> v;
        adj[u].PB({v});
        adj[v].PB({u});
    }

    rep2(i,1,n){
        cnt = 0;
        if(!vis[i])
            dfs(i);
    }
    cout << ans;
    return 0;
}


#include <iostream>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <iomanip>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <utility>
using namespace std;
int ky[8] = {-1,1,-2,2,-2,2,-1,1};
int kx[8] = {-2,-2,-1,-1,1,1,2,2};
int dy[4] = {-1,0,1,0};
int dx[4] = {0,1,0,-1};
typedef long long ll;
#define pi pair
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define rep1(i,a,b) for(int i = a; i < b; i++)
#define rep2(i,a,b) for(int i = a; i <= b; i++)
#define INF 999999999999
int n,m;
vector<int> adj[51];
bool visited[51];
ll ans;
ll d,cnt;
int x,y;

void dfs(int here){
    if(visited[here]) return;
    visited[here] = true;

    for(int i = 0; i < adj[here].size(); i++){
        int next = adj[here][i];
        dfs(next);
    }
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> m;
    rep1(i,0,m){
        cin >> x >> y;
        adj[x].PB(y);
        adj[y].PB(x);
    }

    rep2(i,1,n){
        if(!visited[i]){
            cnt++;
            dfs(i);
        }
    }
    ans = 1;
    d = n - cnt;
 //   cout << cnt << '\n';
    ans = 1 << d;
    cout << ans;
    return 0;
}


#include <iostream>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <iomanip>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <utility>
using namespace std;
int ky[8] = {-1,1,-2,2,-2,2,-1,1};
int kx[8] = {-2,-2,-1,-1,1,1,2,2};
int dy[4] = {-1,0,1,0};
int dx[4] = {0,1,0,-1};
typedef long long ll;
#define pi pair
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define rep1(i,a,b) for(int i = a; i < b; i++)
#define rep2(i,a,b) for(int i = a; i <= b; i++)
#define INF 999999999999
int n,m;
vector<int> adj[51];
bool visited[51];
ll ans;
ll d,cnt;
int x,y;

void dfs(int here){
    if(visited[here]) return;
    visited[here] = true;

    for(int i = 0; i < adj[here].size(); i++){
        int next = adj[here][i];
        dfs(next);
    }
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> m;
    rep1(i,0,m){
        cin >> x >> y;
        adj[x].PB(y);
        adj[y].PB(x);
    }

    rep2(i,1,n){
        if(!visited[i]){
            cnt++;
            dfs(i);
        }
    }
    ans = 1;
    d = n - cnt;
 //   cout << cnt << '\n';
    ans = 1LL << d;
    cout << ans;
    return 0;
}


   #include<bits/stdc++.h>
    #include <ext/pb_ds/assoc_container.hpp>
  #include <ext/pb_ds/tree_policy.hpp>
  #pragma comment(linker, "/stack:200000000")
  #pragma GCC optimize("O3")
  #pragma GCC optimize("Ofast")
  #pragma GCC optimize("unroll-loops")
    using namespace std;
  using namespace __gnu_pbds;
    #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
    #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #define endl "\n"
    #define int long long
    #define all(v) v.begin(),v.end()
    #define rep(i,a,b) for(int i = a; i <=b; i++)
    #define rep2(i,a,b) for(int i = a; i>=b; i--)
    #define f first
    #define s second
    #define PB push_back
    #define MP make_pair
    #define db long double
    #define trace1(x)                cerr<<#x<<": "<<x<<endl
    #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
    #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
    #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
    #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
    #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
    #define cases int testcases;cin>>testcases; while(testcases--)
    #define INF 2000000000
    const double PI = acos(-1);
    const int N = 200005;
    int mod = 1e9 + 7;

    vector<int> parent;
    vector<int> sz;
    vector<int> vis;

    void make_set(int s)
    {
      parent[s] = s;
      sz[s] = 1;
    }
    int find_set(int s)
    {
      if(s == parent[s])
      {
        return s;
      }
      return parent[s] = find_set(parent[s]);
    }
    void merge(int a,int b)
    {
      a = find_set(a);
      b = find_set(b);
      if(a != b)
      {
        if(sz[a] < sz[b])
        {
          swap(a,b);
        }
        sz[a] += sz[b];
        parent[b] = a;
      }
    }
  int32_t main()
  {
    IOS
       #ifndef ONLINE_JUDGE
       freopen("input.txt", "r", stdin);
       freopen("output.txt", "w", stdout);
      #endif

      int n,m;

      cin >> n >> m;

      parent.resize(n+1);
      vis.resize(n+1);
      sz.resize(n+1);

      for(int i = 1; i <= n; i++)
      {
        make_set(i);
      }
      for(int i = 1; i <= m; i++)
      {
        int x, y;
        cin >> x >> y;
        merge(x,y);
      }

      int ans = 0;

      for(int i = 1; i <= n; i++)
      {
        int p = find_set(i);
        if(!vis[p])
        {
          ans += (1 << (sz[p]-1));
          vis[i] = true;
        }
      }

      cout << ans << endl;

    return 0;
  }


   #include<bits/stdc++.h>
    #include <ext/pb_ds/assoc_container.hpp>
  #include <ext/pb_ds/tree_policy.hpp>
  #pragma comment(linker, "/stack:200000000")
  #pragma GCC optimize("O3")
  #pragma GCC optimize("Ofast")
  #pragma GCC optimize("unroll-loops")
    using namespace std;
  using namespace __gnu_pbds;
    #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
    #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #define endl "\n"
    #define int long long
    #define all(v) v.begin(),v.end()
    #define rep(i,a,b) for(int i = a; i <=b; i++)
    #define rep2(i,a,b) for(int i = a; i>=b; i--)
    #define f first
    #define s second
    #define PB push_back
    #define MP make_pair
    #define db long double
    #define trace1(x)                cerr<<#x<<": "<<x<<endl
    #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
    #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
    #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
    #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
    #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
    #define cases int testcases;cin>>testcases; while(testcases--)
    #define INF 2000000000
    const double PI = acos(-1);
    const int N = 200005;
    int mod = 1e9 + 7;

    vector<int> parent;
    vector<int> sz;
    vector<int> vis;

    void make_set(int s)
    {
      parent[s] = s;
      sz[s] = 1;
    }
    int find_set(int s)
    {
      if(s == parent[s])
      {
        return s;
      }
      return parent[s] = find_set(parent[s]);
    }
    void merge(int a,int b)
    {
      a = find_set(a);
      b = find_set(b);
      if(a != b)
      {
        if(sz[a] < sz[b])
        {
          swap(a,b);
        }
        sz[a] += sz[b];
        parent[b] = a;
      }
    }
  int32_t main()
  {
    IOS
       #ifndef ONLINE_JUDGE
       freopen("input.txt", "r", stdin);
       freopen("output.txt", "w", stdout);
      #endif

      int n,m;

      cin >> n >> m;

      parent.resize(n+1);
      vis.resize(n+1);
      sz.resize(n+1);

      for(int i = 1; i <= n; i++)
      {
        make_set(i);
      }
      for(int i = 1; i <= m; i++)
      {
        int x, y;
        cin >> x >> y;
        merge(x,y);
      }

      int ans = 0;

      for(int i = 1; i <= n; i++)
      {
        int p = find_set(i);
        if(!vis[p])
        {
          ans ++;
          vis[p] = true;
        }
      }

      ans = (1 << (n - ans));
      cout << ans << endl;

    return 0;
  }