#include using namespace std; long long mod = 998244353; //入力が必ず-mod= mod) v -= mod; return *this; } mint operator-=(const mint b){ v -= b.v; if(v < 0) v += mod; return *this; } mint operator*=(const mint b){v = v*b.v%mod; return *this;} mint operator/=(mint b){ if(b == 0) assert(false); int left = mod-2; while(left){if(left&1) *this *= b; b *= b; left >>= 1;} return *this; } mint operator++(){*this += 1; return *this;} mint operator--(){*this -= 1; return *this;} mint operator++(int){*this += 1; return *this;} mint operator--(int){*this -= 1; return *this;} bool operator==(const mint b){return v == b.v;} bool operator!=(const mint b){return v != b.v;} bool operator>(const mint b){return v > b.v;} bool operator>=(const mint b){return v >= b.v;} bool operator<(const mint b){return v < b.v;} bool operator<=(const mint b){return v <= b.v;} mint pow(long long n){ mint ret = 1,p = v; if(n < 0) p = p.inv(),n = -n; while(n){ if(n&1) ret *= p; p *= p; n >>= 1; } return ret; } mint inv(){return mint(1)/v;} }; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; vector minus,plus; bool zero = false; while(N--){ int c; cin >> c; if(c == 0) zero = true; else if(c < 0) minus.push_back(abs(c)); else plus.push_back(c); } sort(minus.begin(),minus.end()); sort(plus.begin(),plus.end()); mint answer = 1; if(zero){ if(minus.size() && plus.size()) answer *= 3; else if(minus.size() || plus.size()) answer *= 2; } if(plus.size()) answer *= mint(2).pow(plus.size()-1); if(minus.size()) answer *= mint(2).pow(minus.size()-1); if(plus.size() && minus.size()) answer *= 2; cout << answer.v << endl; }