Language: C++

#include <iostream>
#include <vector>
#include <math.h>
#include <iomanip>
#include <algorithm>
using namespace std;

int main() {
    int n;
    cin >> n;

    vector<int> ls(n);
    for (int i = 0; i < n; i++) {
        cin >> ls[i];
    }

    std::sort(ls.begin(), ls.end());

    if (n % 2 == 0) {
        int count = 1;
        for (int i = 0; i < n; i++) {
            if(ls[i] != count) {
                cout << 0;
                return 0;
            }
            if (i % 2 != 0) {
                count += 2;
            }
        }

        cout << stoull(fmod(pow(2, n / 2), 1000000007));
        return 0;
    } else {
        if (ls[0] != 0) {
            cout << 0;
            return 0;
        }

        int count = 2;
        for (int i = 1; i < n; i++) {
            if(ls[i] != count) {
                cout << 0;
                return 0;
            }
            if (i % 2 == 0) {
                count += 2;
            }
        }
        cout << stoull(fmod(powl(2, (n - 1) / 2), 1000000007));
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:23: error: no matching function for call to 'stoull(__gnu_cxx::__promote<double>::__type)'
   31 |         cout << stoull(fmod(pow(2, n / 2), 1000000007));
      |                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4185:3: note: candidate: 'long long unsigned int std::__cxx11::stoull(const std::string&, std::size_t*, int)'
 4185 |   stoull(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~~~
/usr/include/c++/14/bits/basic_string.h:4185:24: note:   no known conversion for argument 1 from '__gnu_cxx::__promote<double>::__type' {aka 'double'} to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4185 |   stoull(const string& __str, size_t* __idx = 0, int __base = 10)
      |          ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4452:3: note: candidate: 'long long unsigned int std::__cxx11::stoull(const std::wstring&, std::size_t*, int)'
 4452 |   stoull(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~~~
/usr/include/c++/14/bits/basic_string.h:4452:25: note:   no known conversion for argument 1 from '__gnu_cxx::__promote<double>::__type' {aka 'double'} to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4452 |   stoull(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |          ~~~~~~~~~~~~~~~^~~~~
a.cc:49:23: error: no matching function for call to 'stoull(__gnu_cxx::__promote<long double>::__type)'
   49 |         cout << stoull(fmod(powl(2, (n - 1) / 2), 1000000007));
      |                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4185:3: note: candidate: 'long long unsigned int std::__cxx11::stoull(const std::string&, std::size_t*, int)'
 4185 |   stoull(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~~~
/usr/include/c++/14/bits/basic_string.h:4185:24: note:   no known conversion for argument 1 from '__gnu_cxx::__promote<long double>::__type' {aka 'long double'} to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4185 |   stoull(const string& __str, size_t* __idx = 0, int __base = 10)
      |          ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4452:3: note: candidate: 'long long unsigned int std::__cxx11::stoull(const std::wstring&, std::size_t*, int)'
 4452 |   stoull(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~~~
/usr/include/c++/14/bits/basic_string.h:4452:25: note:   no known conversion for argument 1 from '__gnu_cxx::__promote<long double>::__type' {aka 'long double'} to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4452 |   stoull(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |          ~~~~~~~~~~~~~~~^~~~~