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

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

    static class TaskA {
        private static final long MODULO = 998244353;
        private static final int MAX = 200;

        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            //the given array of numbers
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt() - 1;
            }

            // waysLast[0][i] = ways to make the array up to a certain row such that the
            // current element is i, and i is greater than the prior element of the array.
            // waysLast[1][i] = ways to make the array up to a certain row such that the
            // current element is i, and i is less than or equal to the prior element of the array.
            long[][] waysLast = new long[2][MAX];

            // There is 1 way to get the first element. We consider it greater than the last
            // so it won't become a maximum later.
            if (a[0] != -2) {
                waysLast[0][a[0]] = 1;
            } else {
                for (int i = 0; i < MAX; i++) {
                    waysLast[0][i] = 1;
                }
            }

            // like waysLast, but for the next row.
            long[][] waysNext = new long[2][MAX];
            for (int i = 1; i < a.length; i++) {
                if (a[i] == -2) { //  a[i] is unknown
                    long sum = 0;
                    // first count all the ways while going up
                    for (int j = 0; j < MAX; j++) {
                        waysNext[0][j] = sum;
                        sum = (sum + waysLast[0][j] + waysLast[1][j]) % MODULO;
                    }
                    sum = 0;
                    // count all the ways while not going up
                    for (int j = MAX - 1; j >= 0; j--) {
                        sum = (sum + waysLast[1][j]) % MODULO;
                        waysNext[1][j] = (sum + waysLast[0][j]) % MODULO;
                    }
                } else { //  a[i] is a constant
                    //count ways going up
                    for (int j = 0; j < a[i]; j++) {
                        waysNext[0][a[i]] = (waysNext[0][a[i]] + waysLast[0][j] + waysLast[1][j]) % MODULO;
                    }
                    //count ways not going up
                    waysNext[1][a[i]] = waysLast[0][a[i]];
                    for (int j = a[i]; j < MAX; j++) {
                        waysNext[1][a[i]] = (waysNext[1][a[i]] + waysLast[1][j]) % MODULO;
                    }
                }
                waysLast = waysNext;
                waysNext = new long[2][MAX];
            }

            // return the number of ways to get the last element. We consider it more than the
            // next so that we don't make it a maximum.
            long ways = 0;
            if (a[n - 1] != -2) {
                ways = (waysLast[1][a[n - 1]]) % MODULO;
            } else {
                for (int i = 0; i < waysLast[0].length; i++) {
                    ways = (ways + waysLast[1][i]) % MODULO;
                }
            }
            out.println(ways);
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;

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

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

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

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}

