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.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long ans = 0;
        /*for (int i = 0; i < 200; i++) {
            for (int j = i; j < 200; j++) {
                for (int k = 0; k < 200; k++) {
                    for (int l = 0; l <= k; l++) {
                        if((i>=j || k>=j) && (j>=k||l>=k))
                            ans++;
                    }
                }
            }
        }
        System.out.println(ans);

        for (int i = 10; i < 200; i++) {
            for (int j = 0; j < 200; j++) {
                for (int k = 10; k < 200; k++) {
                    if((10>=i ||j>=i)&&(i>=j || k>=j)&&(10>=k||j>=k))
                        ans++;
                }
            }
        }
        System.out.println(ans);*/
            int n = in.ni();
            int[] a = in.na(n);
            for (int i = 0; i < n; i++) {
                if (a[i] != -1) a[i]--;
            }
            long MOD = 998244353;
            //int []a=new int[]{10,-1,-1,-1,10};
            //int n = a.length;
            long[][] de = new long[n][200];
            long[][] dl = new long[n][200];
            long[][] dg = new long[n][200];
            if (a[0] == -1) {
                for (int i = 0; i < 200; i++) {
                    de[0][i] = 1;
                }
                for (int i = 0; i < 199; i++) {
                    dl[0][i] = 1;
                }
            } else {
                de[0][a[0]] = 1;
                if (a[0] < 199)
                    dl[0][a[0]] = 1;
            }

            for (int i = 1; i < n; i++) {
                long less = 0;
                for (int j = 0; j < 200; j++) {
                    de[i][j] = de[i - 1][j];
                    de[i][j] += less;
                    dl[i][j] = de[i - 1][j];
                    dl[i][j] += less;
                    dg[i][j] = de[i - 1][j];
                    less += dl[i - 1][j];
                }
                long greater = 0;
                for (int j = 199; j >= 0; j--) {
                    de[i][j] += greater;
                    dl[i][j] += greater;
                    dg[i][j] += greater;
                    greater += dg[i - 1][j];
                }
                for (int j = 0; j < 200; j++) {
                    if (a[i] != -1 && j != a[i])
                        de[i][j] = dg[i][j] = dl[i][j] = 0;
                    else {
                        de[i][j] %= MOD;
                        dg[i][j] %= MOD;
                        dl[i][j] %= MOD;
                    }
                }
            }
            ans = 0;
            long greater = 0;
            for (int i = 199; i >= 0; i--) {
                if (a[n - 1] == -1) {
                    ans += de[n - 2][i];
                    ans += greater;
                } else {
                    if (a[n - 1] == i) {
                        ans = greater + de[n - 2][i];
                    }
                }
                greater += dg[n - 2][i];
            }
            out.println(ans % MOD);
        }

    }

    static class InputReader extends BufferedReader {
        public InputReader(InputStream st) {
            super(new InputStreamReader(st));
        }

        public String readLine() {
            try {
                return super.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        private int readByte() {
            try {
                return read();
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }

        public int ni() {
            int num = 0, b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }

            while (true) {
                if (b >= '0' && b <= '9') {
                    num = num * 10 + (b - '0');
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

        public int[] na(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = ni();
            return a;
        }

    }
}

