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;
mt19937 gen_rand;
template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &a) {
  os << "(";
  os << a.first << ", ";
  os << a.second;
  os << ")";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &a) {
  os << "{";
  bool was = false;
  for (auto &x : a) {
    if (was) {
      os << ", ";
    }
    was = true;
    os << x;
  }
  os << "}";
  return os;
}
template <typename T>
inline void debug(const char *sdbg, T x) {
  cerr << "The value of " << sdbg << " is " << x << "\n";
};
template <typename T, typename... U>
inline void debug(const char *sdbg, T h, U... t) {
  cerr << "The value of ";
  while (*sdbg != ',') {
    cerr << *sdbg++;
  }
  cerr << " is " << h << "\n";
  debug(sdbg + 1, t...);
  cerr << "\n";
}
template <typename T>
T abs(T x) {
  if (x < 0) {
    return -x;
  } else {
    return x;
  }
}
template <typename T>
T sqr(T x) {
  return x * x;
};
const long long INF_FOR_SHORT_TIME = (long long)(1e9);
template <typename T>
T mul(T a, T b, T m) {
  if (a <= INF_FOR_SHORT_TIME && b <= INF_FOR_SHORT_TIME) {
    return (a * b) % m;
  }
  T q = (long long)((long double)a * (long double)b / (long double)m);
  T r = a * b - q * m;
  return (r + 5 * m) % m;
}
template <typename T, typename U>
T binpow(T a, U n, T MOD) {
  T res = 1;
  while (n) {
    if (n & 1) {
      res = mul(res, a, MOD);
    }
    a = mul(a, a, MOD);
    n >>= 1;
  }
  return res;
};
template <typename T>
int sign(T x) {
  if (x < 0) {
    return -1;
  } else if (x > 0) {
    return 1;
  } else {
    return 0;
  }
};
template <typename T>
T gcd(T a, T b) {
  if (a > b) {
    swap(a, b);
  }
  while (a) {
    b %= a;
    swap(a, b);
  }
  return b;
};
template <typename T>
bool uin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
};
template <typename T>
bool uax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
};
const int mod = 998244353;
const int MAXN = 200;
int main() {
  gen_rand.seed(time(0));
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int dp[2][MAXN + 1][2] = {};
  int cur = 0;
  if (a[0] == -1) {
    for (int x = 1; x <= MAXN; ++x) {
      dp[0][x][0] = 1;
    }
  } else {
    dp[0][a[0]][0] = 1;
  }
  for (int i = 1; i < n; ++i) {
    vector<vector<int>> prv(MAXN + 1, vector<int>(2, 0));
    for (int j = 1; j <= MAXN; ++j) {
      prv[j][0] = (prv[j - 1][0] + dp[cur][j][0]) % mod;
      prv[j][1] = (prv[j - 1][1] + dp[cur][j][1]) % mod;
    }
    if (a[i] != -1) {
      dp[cur ^ 1][a[i]][0] = (prv[a[i] - 1][1] + prv[a[i] - 1][0]) % mod;
      dp[cur ^ 1][a[i]][1] =
          (((prv[MAXN][1] - prv[a[i] - 1][1]) + mod) % mod + dp[cur][a[i]][0]) %
          mod;
      cur ^= 1;
      for (int i = 0; i <= MAXN; ++i) {
        dp[cur ^ 1][i][0] = 0;
        dp[cur ^ 1][i][1] = 0;
      }
      continue;
    }
    for (int x = 1; x <= MAXN; ++x) {
      dp[cur ^ 1][x][0] = (prv[x - 1][1] + prv[x - 1][0]) % mod;
      dp[cur ^ 1][x][1] =
          (((prv[MAXN][1] - prv[x - 1][1]) + mod) % mod + dp[cur][x][0]) % mod;
    }
    cur ^= 1;
  }
  if (a[n - 1] != -1) {
    cout << dp[cur][a[n - 1]][1];
  } else {
    int res = 0;
    for (int x = 1; x <= MAXN; ++x) {
      res = (res + dp[cur][x][1]) % mod;
    }
    cout << res;
  }
  return 0;
}
