#include using namespace std; #include using mint = atcoder::modint998244353; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; if (N == 1) { cout << 1 << endl; return 0; } int pos = 0, neg = 0, zero = 0; for (int i = 0; i < N; i++) { int x; cin >> x; (x > 0 ? pos : x < 0 ? neg : zero)++; } mint ans = 1; if (pos) ans *= mint(2).pow(pos - 1); if (neg) ans *= mint(2).pow(neg - 1); if (pos > 0 && neg > 0) ans *= 2; if (zero > 0) ans *= (pos > 0 && neg > 0 ? 3 : 2); cout << ans.val() << endl; }