#include using namespace std; #define all(v) v.begin(),v.end() #define resort(v) sort(v.rbegin(),v.rend()) using ll = long long; using ull = unsigned long long; using vll=vector; using vvll = vector>; using P = pair; using vp=vector>; using djks=priority_queue>; const ll inf=1ll<<60; #define mod10 (ll)1e9+7 #define mod99 (ll)998244353 const double PI = acos(-1); #define rep(i,n) for (ll i=0;i=0;--i) #define rep2(i,a,n) for (ll i=a;i=a;--i) templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b struct ModInt { int value; ModInt() : value(0) {} ModInt(int value) : value(value % MOD) { if (this->value < 0) this->value += MOD; } ModInt operator+(const ModInt& other) const { return ModInt((value + other.value) % MOD); } ModInt operator-(const ModInt& other) const { return ModInt((value - other.value + MOD) % MOD); } ModInt operator*(const ModInt& other) const { return ModInt((1LL * value * other.value) % MOD); } ModInt operator/(const ModInt& other) const { return *this * other.inv(); } ModInt inv() const { int a = value, b = MOD, u = 1, v = 0; while (b) { int t = a / b; a -= t * b; std::swap(a, b); u -= t * v; std::swap(u, v); } return ModInt(u); } }; void solve() { using mint = ModInt<998244353>; mint pls = 1, mns = 1; int kind_p = 0, kind_m = 0; bool is_zero = false; int n; cin >> n; rep(i, n) { int a; cin >> a; if(a>0) { if(kind_p != 0) { pls = pls * 2; } else kind_p++; } else if (a<0){ if(kind_m != 0) { mns = mns * 2; } else kind_m++; } else is_zero = true; } cout << (pls * mns * (max(kind_p + kind_m, 1)) * ((is_zero) ? 1+kind_p+kind_m : 1)).value << '\n'; } int main() { cin.tie(0); ios::sync_with_stdio(false); int t=1; //cin >> t; while(t--)solve(); }