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. 
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author prakharjain
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        int[][][] dp = new int[2][201][2];
        int mod = 998244353;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();

            int[] a = new int[n];

            in.readArray(a, n, 0);

//        if (n == 2) {
//            if (a[0] == -1 && a[1] == -1) {
//                out.println(200);
//            } else if (a[0] == -1 || a[1] == -1) {
//                out.println(1);
//            } else {
//                if (a[0] == a[1]) {
//                    out.println(1);
//                } else {
//                    out.println(0);
//                }
//            }
//
//            return;
//        }
            int[][] cum = new int[201][2];


            if (a[0] == -1) {
                for (int i = 1; i <= 200; i++) {
                    dp[0][i][0] = 1;
                }
            } else {
                dp[0][a[0]][0] = 1;
            }

            cum[0][0] = dp[0][0][0];
            for (int i = 1; i <= 200; i++) {
                cum[i][0] = cum[i - 1][0] + dp[0][i][0];
            }

            for (int i = 1; i < n; i++) {
                if (i > 1) {
                    if (a[i] != -1) {

                        int j = a[i];

                        dp[1][j][1] = cum[j - 1][0] + cum[j - 1][1];

                        dp[1][j][0] = remcum(j, cum, 0) + dp[0][j][1];

                        dp[1][j][0] %= mod;
                        dp[1][j][1] %= mod;
                    } else {
                        for (int j = 1; j <= 200; j++) {
                            dp[1][j][1] = cum[j - 1][0] + cum[j - 1][1];

                            dp[1][j][0] = remcum(j, cum, 0) + dp[0][j][1];

                            dp[1][j][0] %= mod;
                            dp[1][j][1] %= mod;
                        }
                    }
                } else {
                    if (a[i] != -1) {
                        int j = a[i];

                        dp[1][j][1] = cum[j - 1][0] + cum[j - 1][1];

                        dp[1][j][0] = dp[0][j][0] + dp[0][j][1];

                        dp[1][j][0] %= mod;
                        dp[1][j][1] %= mod;
                    } else {
                        for (int j = 1; j <= 200; j++) {
                            dp[1][j][1] = cum[j - 1][0] + cum[j - 1][1];

                            dp[1][j][0] = dp[0][j][0] + dp[0][j][1];

                            dp[1][j][0] %= mod;
                            dp[1][j][1] %= mod;
                        }
                    }
                }

                cum[0][0] = dp[1][0][0];
                cum[0][1] = dp[1][0][1];
                for (int j = 1; j <= 200; j++) {
                    cum[j][0] = cum[j - 1][0] + dp[1][j][0];
                    cum[j][0] %= mod;
                    cum[j][1] = cum[j - 1][1] + dp[1][j][1];
                    cum[j][1] %= mod;
                }

                for (int j = 0; j <= 200; j++) {
                    dp[0][j][0] = dp[1][j][0];
                    dp[0][j][1] = dp[1][j][1];
                }

                for (int j = 0; j <= 200; j++) {
                    dp[1][j][0] = dp[1][j][1] = 0;
                }
            }

            long ans = cum[200][0];

//        for (int i = 1; i <= 200; i++) {
//            ans += dp[n - 1][i][0];
//            ans += dp[n - 1][i][1];
//
//            ans %= mod;
//        }

            ans %= mod;

            if (ans < 0) {
                ans += mod;
            }

            out.println(ans);
        }

        int remcum(int s, int[][] cum, int o) {
            int val = cum[200][o];

            if (s > 1) {
                val -= cum[s - 1][o];
            }

            val %= mod;

            return val;
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public void readArray(int[] a, int n, int offset) {
            for (int i = 0; i < n; i++) {
                a[i] = nextInt() - offset;
            }
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void println(long i) {
            writer.println(i);
        }

    }
}

