Ivan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. Array is old and some numbers are hard to read. Ivan remembers that for all elements at least one of its neighbours ls not less than it, more formally:

a_{1} ≤ a_{2},

a_{n} ≤ a_{n-1} and

a_{i} ≤ max(a_{i-1},    a_{i+1}) for all i from 2 to n-1.

Ivan does not remember the array and asks to find the number of ways to restore it. Restored elements also should be integers from 1 to 200. Since the number of ways can be big, print it modulo 998244353.

Input

First line of input contains one integer n (2 ≤ n ≤ 10^{5}) — size of the array.

Second line of input contains n integers a_{i} — elements of array. Either a_{i} = -1 or 1 ≤ a_{i} ≤ 200. a_{i} = -1 means that i-th element can't be read.

Output

Print number of ways to restore the array modulo 998244353.

Examples

Input

3
1 -1 2


Output

1


Input

2
-1 -1


Output

200

Note

In the first example, only possible value of a_{2} is 2.

In the second example, a_{1} = a_{2} so there are 200 different values because all restored elements should be integers between 1 and 200. 
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vpii = vector<pii>;
using vl = vector<ll>;
using ld = long double;
using vs = vector<string>;
const int MAXN = (int)1e5 + 22;
const int MAX_VAL = 200;
const int MOD = 998244353;
int N;
vi A;
int dp[MAXN][MAX_VAL][2];
inline void add(int &x, int y) {
  x += y;
  while (x >= MOD) x -= MOD;
  while (x < 0) x += MOD;
}
void solve() {
  cin >> N;
  A.resize(N);
  for (auto &x : A) {
    cin >> x;
    if (x >= 1) x--;
  }
  if (A[0] == -1)
    add(dp[0][0][0], 1);
  else {
    add(dp[0][A[0]][0], 1);
    add(dp[0][A[0] + 1][0], -1);
  }
  for (int i = 0; i < N; i++) {
    for (int f = 0; f < 2; f++) {
      int val = 0;
      for (int last = 0; last < MAX_VAL; last++) {
        add(val, dp[i][last][f]);
        dp[i][last][f] = val;
      }
    }
    if (i >= N - 1) break;
    for (int last = 0; last < MAX_VAL; last++) {
      for (int f = 0; f < 2; f++) {
        auto &state = dp[i][last][f];
        if (!state) continue;
        if (A[i + 1] == -1) {
          int ne = (f ? 0 : last);
          add(dp[i + 1][ne][1], state);
          if (last + 1 < MAX_VAL) {
            add(dp[i + 1][last + 1][1], -state);
            add(dp[i + 1][last + 1][0], state);
          }
        } else {
          int ne = A[i + 1];
          int nf = (last >= ne);
          bool good = (f | (ne >= last));
          if (good) {
            add(dp[i + 1][ne][nf], state);
            if (ne + 1 < MAX_VAL) add(dp[i + 1][ne + 1][nf], -state);
          }
        }
      }
    }
  }
  int ans = 0;
  for (int last = 0; last < MAX_VAL; last++) add(ans, dp[N - 1][last][1]);
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  clock_t start = clock();
  solve();
  cerr << ((double)clock() - start) / CLOCKS_PER_SEC << " sec.";
  return 0;
}
