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.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;

public class D {
	
	int N = 200;
	int n;
	
	final int DONE = 0, MISSING = 1;
	final int mod = 998244353;
	
	int[] a;
	
	long[][][] memo;
	long dp(int ind, int prev, int state) {
		if(ind == n) {
			return state == MISSING ? 0 : 1;
		}
		long ans = 0;
		if(a[ind] != -1) {
			int x = a[ind];
			if(state == MISSING) {
				if(x > prev) ans = dp(ind + 1, x, MISSING);
				if(x == prev) ans = dp(ind + 1, x, DONE);
			} else { //prev is DONE
				if(x <= prev) ans = dp(ind + 1, x, DONE);
				else ans = dp(ind + 1, x, MISSING); //I am greater than previous
			}
		} else if(state == MISSING) {
			for(int i = prev; i <= N; ++i) {
				if(i > prev) ans += dp(ind + 1, i, MISSING);
				else ans += dp(ind + 1, i, DONE); //equal case
				ans %= mod;
			}
		} else {
			for(int i = 1; i <= N; ++i) {
				if(i <= prev) ans += dp(ind + 1, i, DONE);
				else ans += dp(ind + 1, i, MISSING);
				ans %= mod;
			}
		}
		return ans;
	}
	
	long doit() {
		long ans = 0;
		BIT[][] dp = new BIT[2][n + 1];
		for(int i = 0; i < 2; ++i) for(int j = 0; j <= n; ++j) dp[i][j] = new BIT(N + 1);
		for(int ind = n; ind >= 0; --ind) {
			for(int prev = 1; prev <= N; ++prev) {
				for(int state = 0; state < 2; ++state) {
					
					if(ind == n) {
						dp[state][ind].update(prev, state == MISSING ? 0 : 1);
						continue;
					}
					
					if(a[ind] != -1) {
						int x = a[ind];
						if(state == MISSING) {
							if(x > prev) dp[state][ind].update(prev, dp[MISSING][ind + 1].sum(x, x));
							if(x == prev) dp[state][ind].update(prev, dp[DONE][ind + 1].sum(x, x));
						} else { //prev is DONE
							if(x <= prev) dp[state][ind].update(prev, dp[DONE][ind + 1].sum(x, x));
							else dp[state][ind].update(prev, dp[MISSING][ind + 1].sum(x, x)); //I am greater than previous
						}
					} else if(state == MISSING) {
						dp[state][ind].update(prev, dp[DONE][ind + 1].sum(prev, prev));
						dp[state][ind].update(prev, dp[MISSING][ind + 1].sum(prev + 1, N));
					} else {
						dp[state][ind].update(prev, dp[DONE][ind + 1].sum(1, prev));
						dp[state][ind].update(prev, dp[MISSING][ind + 1].sum(prev + 1, N));
					}
					
				}
			}
		}
		
		return dp[DONE][0].sum(N, N);
	}
	
	int sum(int[] arr, int l, int r) {
		int ans = arr[r];
		if(l > 0) ans -= arr[l - 1];
		if(ans < 0) ans += mod;
		return ans;
	}
	
	
	long doit2() {
		long ans = 0;
		int[][][] dp = new int[2][n + 1][N + 1];
		for(int ind = n; ind >= 0; --ind) {
				for(int state = 0; state < 2; ++state) {
					for(int prev = 1; prev <= N; ++prev) {
					
					if(ind == n) {
						dp[state][ind][prev] = state == MISSING ? 0 : 1;
						continue;
					}
					
					if(a[ind] != -1) {
						int x = a[ind];
						if(state == MISSING) {
							if(x > prev) dp[state][ind][prev] = sum(dp[MISSING][ind + 1], x, x);
							if(x == prev) dp[state][ind][prev] = sum(dp[DONE][ind + 1], x, x);
						} else { //prev is DONE
							if(x <= prev) dp[state][ind][prev] = sum(dp[DONE][ind + 1], x, x);
							else dp[state][ind][prev] = sum(dp[MISSING][ind + 1],x, x); //I am greater than previous
						}
					} else if(state == MISSING) {
						dp[state][ind][prev] = sum(dp[DONE][ind + 1], prev, prev);
						dp[state][ind][prev] = sum(dp[MISSING][ind + 1], prev + 1, N);
					} else {
						dp[state][ind][prev] = sum(dp[DONE][ind + 1], 1, prev);
						dp[state][ind][prev] = sum(dp[MISSING][ind + 1], prev + 1, N);
					}
					
				}
					for(int prev = 1; prev <= N; ++prev) {
						dp[state][ind][prev] += dp[state][ind][prev - 1];
					}
			}
		}
		
		return sum(dp[DONE][0], N, N);
	}
	
	public void solve(JS in, PrintWriter out) {
		 n = in.nextInt();
		 a = new int[n];
		 memo = new long[2][N + 1][n];
		 for(long[][] x : memo) for(long[] y : x) Arrays.fill(y, -1);
		 for(int i = 0; i < n; ++i) a[i] = in.nextInt();
		 if(n == 2) {
			 if(a[0] == -1 && a[1] == -1) {
				 out.println(N);
			 } else if(Math.min(a[0], a[1]) == -1) {
				 out.println(1);
			 } else {
				 out.println(0);
			 }
		 } else out.println(doit2());
	}
	
	public static void main(String[] args) {
		JS in = new JS();
		PrintWriter out = new PrintWriter(System.out);
		new D().solve(in, out);
		out.close();
	}
	
	class BIT {
		int n;
		int[] tree;
		
		public BIT(int nn) {
			n = nn + 10;
			tree = new int[n + 1];
		}
		
		int read(int i) {
			i += 5;
			int sum = 0;
			while (i > 0) {
				sum += tree[i];
				sum %= mod;
				i -= i & -i;
			}
			return sum;
		}
		
		int sum(int l, int r) {
			int ans = read(r) - read(l - 1);
			if(ans < 0) ans += mod;
			return ans;
		}
		
		void update(int i, int val) {
			i += 5;
			while (i <= n) {
				tree[i] += val;
				tree[i] %= mod;
				i += i & -i;
			}
		}
	}
	
	static class JS {
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
}
