#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
const int MOD = 1000000007;
int N, M;
vector<int> A, B, W;
vector<pair<int, int> > graph[400400];
int uf[400400];
int pow2[500500];
int odd[400400];
int root(int p)
{
return (uf[p] < 0) ? p : (uf[p] = root(uf[p]));
}
bool join(int p, int q)
{
p = root(p); q = root(q);
if (p == q) return false;
uf[p] += uf[q];
uf[q] = p;
return true;
}
int ans;
int visit(int p, int rt)
{
int ret = odd[p];
for (auto e : graph[p]) if (e.first != rt) {
int s = visit(e.first, p);
if (s % 2) ans = (ans + pow2[e.second]) % MOD;
ret += s;
}
return ret;
}
int main()
{
scanf("%d%d", &N, &M);
for (int i = 0; i < N; ++i) uf[i] = -1;
ans = 0;
pow2[0] = 2;
for (int i = 0; i < M; ++i) {
int x, y;
scanf("%d%d", &x, &y);
--x; --y;
odd[x] ^= 1;
odd[y] ^= 1;
if (join(x, y)) {
A.push_back(x); B.push_back(y); W.push_back(i);
graph[x].push_back(make_pair(y, i));
graph[y].push_back(make_pair(x, i));
}
if (i) pow2[i] = pow2[i - 1] * 2 % MOD;
ans = (ans + pow2[i]) % MOD;
}
visit(0, -1);
printf("%d\n", ans);
return 0;
}