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;
const int di[] = {-1, -1, 1, 1};
const int dj[] = {-1, 1, 1, -1};
const int dl[] = {0, 0, 0, -1};
const int dr[] = {0, 0, -1, 0};
int lg(long long x) {
  int res = 0;
  for (int i = 0; i < x; i++) {
    long long GT = (1ll << i);
    if (GT <= x) {
      res = i;
    } else {
      return res;
    }
  }
  return res;
}
long long GCD(long long a, long long b) {
  if (b == 0) {
    return abs(a);
  }
  return GCD(b, a % b);
}
long long sqr(long long x) { return x * x; }
long long nhan(long long a, long long b, long long module) {
  a %= module;
  b %= module;
  long long q = (long double)a * b / module;
  long long r = (a * b - q * module) % module;
  if (r < 0) {
    r += module;
  }
  return r;
}
long long MU(long long a, long long n, long long module) {
  long long res = 1;
  for (; n; n = n >> 1, a = nhan(a, a, module)) {
    if (n & 1) {
      res = nhan(res, a, module);
    }
  }
  return res;
}
void hamZ(string S, int z[]) {
  int n = S.size();
  for (int i = 0; i <= n; i++) {
    z[i] = 0;
  }
  int L = 1, R = 1;
  for (int i = 2; i <= n; i++) {
    if (i <= R) {
      z[i] = min(z[i - L + 1], R - i + 1);
    }
    while (i + z[i] <= n && S[z[i]] == S[i + z[i] - 1]) {
      z[i]++;
    }
    if (i + z[i] - 1 > R) {
      R = i + z[i] - 1;
      L = i;
    }
  }
}
void Sang(int N, int p[]) {
  for (int i = 0; i <= N; i++) {
    p[i] = 0;
  }
  for (int i = 2; i <= N; i++) {
    p[i] = i;
  }
  int gt = sqrt(N);
  for (int i = 2; i <= N; i++) {
    if (p[i] == i) {
      if (i > gt) {
        continue;
      }
      int j = i * i;
      while (j <= N) {
        p[j] = i;
        j += i;
      }
    }
  }
}
struct Point {
  int x, y;
  Point(){};
  Point(int a, int b) {
    x = a;
    y = b;
  }
};
const int N = 2e5 + 5;
const double sodu = 1e-9;
const long long oo = 1e18;
const int module = 998244353;
const int M = 1e9 + 7;
const int NN = (1 << 16);
int n, a[N];
int F[100001][201][3];
int T[100001][201][3];
void nhap() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
}
int Cong(int a, int b) {
  int res = a + b;
  if (res >= module) {
    res -= module;
  }
  return res;
}
int Tru(int a, int b) {
  int res = a - b;
  if (res < 0) {
    res += module;
  }
  return res;
}
void cn(int pos) {
  for (int type = 0; type <= 2; type++) {
    for (int i = 1; i <= 200; i++) {
      T[pos][i][type] = T[pos][i - 1][type] + F[pos][i][type];
      if (T[pos][i][type] >= module) {
        T[pos][i][type] -= module;
      }
    }
  }
}
void solve() {
  if (n == 2) {
    if (a[1] + a[2] == -2) {
      cout << 200;
      return;
    }
    if (a[1] == -1 || a[2] == -1) {
      cout << 1;
      return;
    }
    if (a[1] == a[2]) {
      cout << 1;
      return;
    }
    cout << 0;
    return;
  }
  if (a[2] != -1) {
    if (a[1] > a[2]) {
      cout << 0;
      return;
    }
    if (a[1] == -1) {
      F[2][a[2]][1] = 1;
      F[2][a[2]][0] = a[2] - 1;
    } else {
      if (a[1] == a[2]) {
        F[2][a[2]][1] = 1;
      } else {
        F[2][a[2]][0] = 1;
      }
    }
  } else {
    if (a[1] == -1) {
      for (int i = 1; i <= 200; i++) {
        F[2][i][1] = 1;
        F[2][i][0] = i - 1;
      }
    } else {
      for (int i = a[1] + 1; i <= 200; i++) {
        F[2][i][0] = 1;
      }
      F[2][a[1]][1] = 1;
    }
  }
  cn(2);
  for (int i = 3; i <= n; i++) {
    if (a[i] != -1) {
      F[i][a[i]][0] = Cong(Cong(T[i - 1][a[i] - 1][0], T[i - 1][a[i] - 1][1]),
                           T[i - 1][a[i] - 1][2]);
      F[i][a[i]][1] =
          Cong(Cong(F[i - 1][a[i]][0], F[i - 1][a[i]][1]), F[i - 1][a[i]][2]);
      int A = 0;
      int B = T[i - 1][200][1] - T[i - 1][a[i]][1];
      int C = T[i - 1][200][2] - T[i - 1][a[i]][2];
      F[i][a[i]][2] = Cong(Cong(A, B), C);
    } else {
      for (int j = 1; j <= 200; j++) {
        F[i][j][0] = Cong(Cong(T[i - 1][j - 1][0], T[i - 1][j - 1][1]),
                          T[i - 1][j - 1][2]);
        F[i][j][1] = Cong(Cong(F[i - 1][j][0], F[i - 1][j][1]), F[i - 1][j][2]);
        int A = 0;
        int B = T[i - 1][200][1] - T[i - 1][j][1];
        int C = T[i - 1][200][2] - T[i - 1][j][2];
        F[i][j][2] = Cong(Cong(A, B), C);
      }
    }
    cn(i);
  }
  int Res = 0;
  if (a[n] != -1) {
    cout << Cong(F[n][a[n]][2], F[n][a[n]][1]);
  } else {
    for (int i = 1; i <= 200; i++) {
      Res += Cong(F[n][i][2], F[n][i][1]);
      if (Res >= module) {
        Res -= module;
      }
    }
    cout << Res;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  nhap();
  solve();
}
