Language: C++

#include<bits/stdc++.h>
using anemspace std;
int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  for(auto& ai:a)cin>>ai;
  
  map<int,int64_t> mp;
  for(auto const& ai:a)mp[ai]++;
  
  constexpr int64_t mod = 1e9+7;
  
  if(n&1){
    bool ok = true;
    if(mp[0]!=1)ok=false;
    for(auto& [k,v]:mp){
      if(k%2!=0)ok=false;
      if(k!=0&&v!=2)ok=false;
    }
    if(!ok){cout<<0<<endl;return 0;}
    int64_t ans = 1;
    for(int i=0;i<n/2;++i)(ans*=2)%=mod;
    cout<<ans<<endl;
  }
  else{
    bool ok = true;
    for(auto& [k,v]:mp){
      if(k%2==0)ok=false;
      if(v!=2)ok=false;
    }
    if(!ok){cout<<0<<endl;return 0;}
    int64_t ans = 1;
    for(int i=0;i<n/2;++i)(ans*=2)%=mod;
    cout<<ans<<endl;
  }
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'anemspace'
    2 | using anemspace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> a(n);
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> a(n);
      |          ^~~
a.cc:7:16: error: 'a' was not declared in this scope; did you mean 'ai'?
    7 |   for(auto& ai:a)cin>>ai;
      |                ^
      |                ai
a.cc:9:3: error: 'map' was not declared in this scope
    9 |   map<int,int64_t> mp;
      |   ^~~
a.cc:9:3: note: suggested alternatives:
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152:
/usr/include/c++/14/bits/stl_map.h:102:11: note:   'std::map'
  102 |     class map
      |           ^~~
/usr/include/c++/14/map:89:13: note:   'std::pmr::map'
   89 |       using map
      |             ^~~
a.cc:9:7: error: expected primary-expression before 'int'
    9 |   map<int,int64_t> mp;
      |       ^~~
a.cc:10:22: error: 'a' was not declared in this scope; did you mean 'ai'?
   10 |   for(auto const& ai:a)mp[ai]++;
      |                      ^
      |                      ai
a.cc:10:24: error: 'mp' was not declared in this scope
   10 |   for(auto const& ai:a)mp[ai]++;
      |                        ^~
a.cc:16:8: error: 'mp' was not declared in this scope
   16 |     if(mp[0]!=1)ok=false;
      |        ^~
a.cc:17:21: error: 'mp' was not declared in this scope
   17 |     for(auto& [k,v]:mp){
      |                     ^~
a.cc:21:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 |     if(!ok){cout<<0<<endl;return 0;}
      |             ^~~~
      |             std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:21:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   21 |     if(!ok){cout<<0<<endl;return 0;}
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:24:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   24 |     cout<<ans<<endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:24:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   24 |     cout<<ans<<endl;
      |                ^~~~
      |                std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:28:21: error: 'mp' was not declared in this scope
   28 |     for(auto& [k,v]:mp){
      |                     ^~
a.cc:32:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   32 |     if(!ok){cout<<0<<endl;return 0;}
      |             ^~~~
      |             std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:32:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   32 |     if(!ok){cout<<0<<endl;return 0;}
      |                      ^~~~
      |                      std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:35:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   35 |     cout<<ans<<endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:35:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   35 |     cout<<ans<<endl;
      |                ^~~~
      |                std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~