Language: C++

#include <bits/stdc++.h>

#define GET_BIT(n, i) (((n) & (1 << ((i)-1))) >> ((i)-1)) // i start from 1
#define SET_BIT(n, i) ((n) | (1 << ((i)-1)))
#define CLR_BIT(n, i) ((n) & ~(1 << ((i)-1)))
#define SHOW_A(x) {cout << #x << " = " << x << endl;}
#define SHOW_B(x, y) {cout << #x << " = " << x << ", " << #y << " = " << y << endl;}
#define SHOW_C(x, y, z) {cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl;}
#define REACH_HERE {cout << "REACH_HERE! line: " << __LINE__ << endl;}
#define ASSERT(x) { _assert(x); cout << #x << endl; }

const double E = 1e-8;
const double PI = acos(-1);

using namespace std;

const int MAX_N = 100005, MAX_M = 10005;
const int MOD_BASE = 1000000007;

bool link[MAX_N];

int power_modulo(int n, int p, int M) {
    int result = 1;
    while (p > 0) {
        if (p % 2 == 1)
            result = ((long long)result*n) % M;
        p /= 2;
        n = ((long long)n*n) % M;
    }
    return result;
}

int mark(int num) {
    if (!link[num]) {
        link[num] = true;
        return 1;
    }
    return 0;
}

void solve(int n, int m) {
    fill(link, link+n, false);
    int total = 0;
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        total += mark(a) + mark(b);
    }
    int ans = 0;
    if (total > 0) {
        ans = 1 + 2 * power_modulo(2, n - total, MOD_BASE);
    } else {
        ans += power_modulo(2, n - total, MOD_BASE);
    }
    cout << ans << endl;
}

int main() {
    ios::sync_with_stdio(false);

    while (true) {
        int n, m;
        cin >> n >> m;
        if (n == 0 && m == 0) break;
        solve(n, m);
    }

    return 0;
}

Compiler output:
a.cc:20:16: error: 'bool link [100005]' redeclared as different kind of entity
   20 | bool link[MAX_N];
      |                ^
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /usr/include/c++/14/csignal:42,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:116,
                 from a.cc:1:
/usr/include/unistd.h:819:12: note: previous declaration 'int link(const char*, const char*)'
  819 | extern int link (const char *__from, const char *__to)
      |            ^~~~
a.cc: In function 'int mark(int)':
a.cc:34:18: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   34 |     if (!link[num]) {
      |                  ^
a.cc:35:17: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   35 |         link[num] = true;
      |                 ^
a.cc:35:19: error: assignment of read-only location '*(link + ((sizetype)num))'
   35 |         link[num] = true;
      |         ~~~~~~~~~~^~~~~~
a.cc: In function 'void solve(int, int)':
a.cc:42:20: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   42 |     fill(link, link+n, false);
      |                ~~~~^~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = int (*)(const char*, const char*) noexcept; _Tp = bool; typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type = void]':
/usr/include/c++/14/bits/stl_algobase.h:998:21:   required from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = int (*)(const char*, const char*) noexcept; _Tp = bool]'
  998 |     { std::__fill_a1(__first, __last, __value); }
      |       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1029:20:   required from 'void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = int (*)(const char*, const char*) noexcept; _Tp = bool]'
 1029 |       std::__fill_a(__first, __last, __value);
      |       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:42:9:   required from here
   42 |     fill(link, link+n, false);
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:952:18: error: assignment of read-only location '* __first'
  952 |         *__first = __tmp;
      |         ~~~~~~~~~^~~~~~~