#include #include using namespace std; using ll = long long; using mint = atcoder::modint998244353; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); int N; cin >> N; vector neg, pos; bool f = false; for(int i = 0; i < N; i++) { int x; cin >> x; if(x < 0) neg.push_back(x); else if(x > 0) pos.push_back(x); else f = true; } int K = neg.size(); int L = pos.size(); if(neg.empty() && pos.empty()) { cout << 1 << endl; return 0; } if(!neg.empty() && !pos.empty()) { mint ans = mint::raw(2).pow(K - 1) * mint::raw(2).pow(L - 1) * 2 * (f ? 3 : 1); cout << ans.val() << endl; } else { mint ans = mint::raw(2).pow(K + L - 1); if(f) { ans *= 2; } cout << ans.val() << endl; } }