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.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;


public class Main {

	static class Task {
		
		int NN = 300005;
		int MOD = 1000000007;
		int INF = 2009000000;
		long INFINITY = 2000000000000000000L;
		
		int [] a;
		int n;
		
		long [][]dp;
		long [][]dp1;
		long [][]sum1;
		
		public void solve(InputReader in, PrintWriter out) {
			n = in.nextInt();
			a = new int[n];
			dp = new long [201][2];
			dp1 = new long [201][2];
			sum1 = new long [201][2];
			for(int i=0;i<n;++i)
				a[i] = in.nextInt();
			for(int i=n-1;i>=1;--i) {
				for(int p=1;p<=200;++p) {
					for(int f=0;f<2;++f) {
						if(i == n - 1) {
							if(a[i] == -1) {
								if(f == 0)
									dp[p][f] = 1;
								else 
									dp[p][f] = p;
							} else {
								if(f==1)
									dp[p][f] = a[i] <= p ? 1: 0;
								else 
									dp[p][f] = (a[i]==p ? 1: 0);								
							}
						} else {
							if(f == 0) {
								if(a[i] != -1) {
									if(a[i] < p)
										dp[p][f] = 0;
									else 
										dp[p][f] = dp1[a[i]][a[i]==p?1:0];
								} else {
									dp[p][f] = (dp1[p][1] + 
											(sum1[200][0]-sum1[p-1][0]-dp1[p][0]))%998244353;
								}
							} else {
								if(a[i] != -1) {
									dp[p][f] = dp1[a[i]][a[i]<=p?1:0];
								} else {
									dp[p][f] = (sum1[p][1] + 
											(sum1[200][0]-sum1[p][0]) + 998244353)%998244353;
								}
							}
						}						
					}
				}
				for(int p=1;p<=200;++p) {
					for(int f=0;f<2;++f) {
						dp1[p][f] = dp[p][f];
					}
				}
				sum1[0][0] = sum1[0][1] = 0;
				for(int f=0;f<2;++f) {
					for(int p=1;p<=200;++p) {
						sum1[p][f] = (sum1[p-1][f] + dp1[p][f])%998244353;
					}
				}
			}
			if(a[0] != -1) {
				out.println(dp[a[0]][0]);	
			} else {
				long ans = 0;
				for(int i=1;i<=200;++i) {
					ans = (ans + dp[i][0])%998244353;
				}
				out.println(ans);
			}
		}
		
	}
	
	static void prepareIO(boolean isFileIO) {
		//long t1 = System.currentTimeMillis();
		Task solver = new Task();
		// Standard IO
		if(!isFileIO) { 
			InputStream inputStream = System.in;
	        OutputStream outputStream = System.out;
	        InputReader in = new InputReader(inputStream);
	        PrintWriter out = new PrintWriter(outputStream);
	        solver.solve(in, out);
	        //out.println("time(s): " + (1.0*(System.currentTimeMillis()-t1))/1000.0);
	        out.close();
		}
        // File IO
		else {
			String IPfilePath = System.getProperty("user.home") + "/Downloads/ip.in";
	        String OPfilePath = System.getProperty("user.home") + "/Downloads/op.out";
	        InputReader fin = new InputReader(IPfilePath);
	        PrintWriter fout = null;
	        try {
				fout = new PrintWriter(new File(OPfilePath));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
	        solver.solve(fin, fout);
	        //fout.println("time(s): " + (1.0*(System.currentTimeMillis()-t1))/1000.0);
	        fout.close();
		}
	}
	
	public static void main(String[] args) {
        prepareIO(false);
	}
	
	static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }
        
        public InputReader(String filePath) {
        	File file = new File(filePath);
            try {
				reader = new BufferedReader(new FileReader(file));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
            tokenizer = null;
        }
        
        public String nextLine() {
        	String str = "";
        	try {
				str = reader.readLine();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
        	return str;
        }
        
        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
        	return Double.parseDouble(next());
        }
        
    }

}