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.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws IOException {
        PrintWriter out = new PrintWriter(System.out);
        //Scanner sc = new Scanner();
        Reader in = new Reader();
        Main solver = new Main();
        solver.solve(out, in);
        out.flush();
        out.close();
 
    }
 
    //<>
    // dp[i][j] - j==0 : the number of times we restore the first i items of the array such that
    // the element before the last element is lesser than the last one.  j==1 is the oposite of 
    // the condition of j==0.
    
    static int maxn = (int)1e5*2;
    static long mod=998244353 ;
    static int n,m,t;
    
    
    void solve(PrintWriter out, Reader in) throws IOException{   
        n = in.nextInt();
        int[] arr = new int[n];
        
        for(int i=0;i<n;i++) arr[i] = in.nextInt();
        
        long dp[][] = new long[201][2];
        if(arr[0]==-1) for(int i=1;i<=200;i++) dp[i][0] = 1;
        else dp[arr[0]][0]=1;
        
        
        for(int s=1;s<n;s++){
            long[][] new_dp = new long[201][2];
            
            if(arr[s]==-1){
                for(int i=2;i<=200;i++){
                    dp[i][0] = dp[i][0]+dp[i-1][0];
                    if(dp[i][0]>=mod) dp[i][0]-=mod;
                    dp[i][1] = dp[i][1]+dp[i-1][1];
                    if(dp[i][1]>=mod) dp[i][1]-=mod;
                }
                
                for(int i=1;i<=200;i++){
                    new_dp[i][0] = (dp[i-1][0]+dp[i-1][1])%mod;
                    new_dp[i][1] = (dp[200][1]-dp[i-1][1]+mod)%mod;
                    new_dp[i][1] = (new_dp[i][1]+dp[i][0]-dp[i-1][0]+mod)%mod;
                }
            }else{
                for(int i=1;i<arr[s];i++) new_dp[arr[s]][0] = (new_dp[arr[s]][0]+dp[i][0]+dp[i][1])%mod;
                for(int i=200;i>arr[s];i--) new_dp[arr[s]][1] = (new_dp[arr[s]][1]+dp[i][1])%mod;
                new_dp[arr[s]][1] = (new_dp[arr[s]][1]+dp[arr[s]][1]+dp[arr[s]][0])%mod;
            }
            
            dp = new_dp;
        }
        
        long ans =0;
        for(int i=1;i<=200;i++) ans= (ans+dp[i][1])%mod;
        out.println(ans);
    }
    
    static class Node implements Comparable<Node>{
        int idx,v;
        
        Node(int idx,int v){
            this.idx = idx;
            this.v = v;
        }
        
        public int compareTo(Node o){
            return this.v-o.v;
        }
    }
    
    static class Edge {
        int d,w;
        
        Edge(int d,int w){
            this.d = d;
            this.w = w;
        }
    }
    
    
    static class Reader {
 
        private InputStream mIs;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
 
        public Reader() {
            this(System.in);
        }
 
        public Reader(InputStream is) {
            mIs = is;
        }
 
        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
 
        }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = mIs.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }
 
        public String nextLine() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }
 
        public String next() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }
 
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
 
        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long 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 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) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
        public boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
 
    }
}