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.awt.List;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.TreeSet;



public final class CF_518_D1_A {

	static boolean verb=true;
	static void log(Object X){if (verb) System.err.println(X);}
	static void log(Object[] X){if (verb) {for (Object U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(int[] X){if (verb) {for (int U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(int[] X,int L){if (verb) {for (int i=0;i<L;i++) System.err.print(X[i]+" ");System.err.println("");}}
	static void log(long[] X){if (verb) {for (long U:X) System.err.print(U+" ");System.err.println("");}}

	static void logWln(Object X){if (verb) System.err.print(X);}
	static void info(Object o){	System.out.println(o);}
	static void output(Object o){outputWln(""+o+"\n");	}
	static void outputWln(Object o){try {out.write(""+ o);} catch (Exception e) {}}



	// Global vars
	static BufferedWriter out;
	static InputReader reader;


	static long mod=998244353;
	static int CX=3;

	static int INF=0,EQ=1,SUP=2,SPEC=3;

	static int comp(int a,int b){
		if (a==b)
			return EQ;
		if (a>b)
			return SUP;

		return INF;
	}

	static String[] name={"INF","EQ","SUP","SPEC"};

	static long solveSlow(int[] a){
		int n=a.length;
		long[][] dp=new long[CX][MX];
		if (a[0]>0){
			dp[SPEC][a[0]]=1;
		} else {
			for (int u=1;u<MX;u++)
				dp[SPEC][u]=1;
		}

		int[] base=new int[MX-1];
		for (int u=1;u<MX;u++)
			base[u-1]=u;
		int[] single=new int[1];
		long tot=0;
		int[] ref;
		for (int i=1;i<n;i++){
			//log("==========="+i);
			long[][] nxt=new long[CX][MX];
			if (a[i]>=0)
				ref=new int[]{a[i]};
			else
				ref=base;

			//log(ref);
			for (int v:ref){
				for (int u=1;u<MX;u++){
					int f=comp(v,u);
					//log("f:"+f);
					for (int e=0;e<CX;e++){
						if (dp[e][u]>0){

							if (
									((i<n-1)&& ((e==INF ||e==EQ)||((e==SUP||e==SPEC) && u<=v)))
									||
									(i==n-1 && (
											((e==INF ||e==EQ)&&(u<=v))
											|| (e==SPEC && u==v)
											)
											)
									)

							{
								nxt[f][v]+=dp[e][u];
								if (nxt[f][v]>=mod)
									nxt[f][v]-=mod;
								if (i==n-1){
									tot+=nxt[f][v];
									if (tot>=mod)
										tot-=mod;
								}
								//log(name[e]+" u:"+u+" "+name[f]+" v:"+v+" dp:"+dp[e][u]);
							}
						}

					}
				}
			}
			dp=nxt;
		}



		return tot;
	}
	
	static long add(long a,long b){
		long c=a+b;
		if (c>=mod)
			c-=mod;
		return c;
	}

	static long solveLessSlow(int[] a){
		int n=a.length;
		long[][] dp=new long[CX][MX];
		long[][] sum=new long[CX][MX];
		if (a[0]>0){
			dp[SUP][a[0]]=1;
		} else {
			for (int u=1;u<MX;u++)
				dp[SUP][u]=1;
		}

		for (int u=1;u<MX;u++){
			for (int e=0;e<CX;e++){
				sum[e][u]=dp[e][u]+sum[e][u-1];
				if (sum[e][u]>=mod)
					sum[e][u]-=mod;

			}
		}

		int[] base=new int[MX-1];
		for (int u=1;u<MX;u++)
			base[u-1]=u;
		int[] single=new int[1];
		long tot=0;
		int[] ref;
		for (int i=1;i<n;i++){

			//log("==========="+i);
			long[][] nxt=new long[CX][MX];
			if (a[i]>=0)
				ref=new int[]{a[i]};
			else
				ref=base;

			//log(ref);
			for (int v:ref){
				
				for (int e=0;e<CX;e++){
					if (e==INF||e==EQ){
						if (i<n-1){
							//take all
							// u==v
							nxt[EQ][v]=add(nxt[EQ][v],dp[e][v]);
							// u<v
							if (v>0)
								nxt[SUP][v]=add(nxt[SUP][v],sum[e][v-1]);
							
							// u>v
							long delta=sum[e][MX-1];
							delta+=mod-sum[e][v];
							if (delta>=mod)
								delta-=mod;
							nxt[INF][v]=add(nxt[INF][v],delta);
							
						} else {
							
							//take only u>=v
							// u==v
							nxt[EQ][v]=add(nxt[EQ][v],dp[e][v]);
							
							// u>v
							long delta=sum[e][MX-1];
							delta+=mod-sum[e][v];
							if (delta>=mod)
								delta-=mod;
							nxt[INF][v]=add(nxt[INF][v],delta);
							
							
						}
					} else
						if (e==SPEC ||e==SUP){
							if (i<n-1){
								// take u<=v
								// u==v
								nxt[EQ][v]=add(nxt[EQ][v],dp[e][v]);
								// u<v
								if (v>0)
									nxt[SUP][v]=add(nxt[SUP][v],sum[e][v-1]);
								
						

								
							}
							if (i==n-1){
								// take u==v
								nxt[EQ][v]=add(nxt[EQ][v],dp[e][v]);
								
								
							}
						}
				}
			
			}
			
			dp=nxt;
			for (int e=0;e<CX;e++)
				sum[e][0]=0;

			for (int e=0;e<CX;e++) {
				for (int u=1;u<MX;u++){
					sum[e][u]=sum[e][u-1]+dp[e][u];
					if (sum[e][u]>=mod)
						sum[e][u]-=mod;


				}
				//log(name[e]+" "+sum[e][MX-1]);
				if (i==n-1){
					tot+=sum[e][MX-1];
					if (tot>=mod)
						tot-=mod;
				}
			}
			//log("----");
		}



		return tot;
	}

	static int MX=201;

	static void process() throws Exception {


		out = new BufferedWriter(new OutputStreamWriter(System.out));
		reader=new InputReader(System.in);

		int n=reader.readInt();
		int[] a=new int[n];
		for (int i=0;i<n;i++){
			a[i]=reader.readInt();
		}
		output(solveLessSlow(a));




		try {
			out.close();
		}
		catch (Exception EX){}


	}


	public static void main(String[] args) throws Exception {
		process();

	}

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

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

		private int read() throws IOException {
			if (curChar >= numChars) {
				curChar = 0;
				numChars = stream.read(buf);
				if (numChars <= 0) {
					return -1;
				}
			}
			return buf[curChar++];
		}


		public final String readString() throws IOException {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res=new StringBuilder();
			do {
				res.append((char)c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public final int readInt() throws IOException {
			int c = read();
			boolean neg=false;
			while (isSpaceChar(c)) {
				c = read();
			}
			char d=(char)c;
			//log("d:"+d);
			if (d=='-') {
				neg=true;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			//log("res:"+res);
			if (neg)
				return -res;
			return res;

		}

		public final long readLong() throws IOException {
			int c = read();
			boolean neg=false;
			while (isSpaceChar(c)) {
				c = read();
			}
			char d=(char)c;
			//log("d:"+d);
			if (d=='-') {
				neg=true;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			//log("res:"+res);
			if (neg)
				return -res;
			return res;

		}




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


}