Once again, Boris needs the help of Anton in creating a task. This time Anton needs to solve the following problem:

There are two arrays of integers a and b of length n. It turned out that array a contains only elements from the set \{-1, 0, 1\}.

Anton can perform the following sequence of operations any number of times:

  1. Choose any pair of indexes (i, j) such that 1 ≤ i < j ≤ n. It is possible to choose the same pair (i, j) more than once. 
  2. Add a_i to a_j. In other words, j-th element of the array becomes equal to a_i + a_j. 



For example, if you are given array [1, -1, 0], you can transform it only to [1, -1, -1], [1, 0, 0] and [1, -1, 1] by one operation.

Anton wants to predict if it is possible to apply some number (zero or more) of these operations to the array a so that it becomes equal to array b. Can you help him?

Input

Each test contains multiple test cases. 

The first line contains the number of test cases t (1 ≤ t ≤ 10000). The description of the test cases follows.

The first line of each test case contains a single integer n (1 ≤ n ≤ 10^5) — the length of arrays.

The second line of each test case contains n integers a_1, a_2, ..., a_n (-1 ≤ a_i ≤ 1) — elements of array a. There can be duplicates among elements.

The third line of each test case contains n integers b_1, b_2, ..., b_n (-10^9 ≤ b_i ≤ 10^9) — elements of array b. There can be duplicates among elements.

It is guaranteed that the sum of n over all test cases doesn't exceed 10^5.

Output

For each test case, output one line containing "YES" if it's possible to make arrays a and b equal by performing the described operations, or "NO" if it's impossible.

You can print each letter in any case (upper or lower).

Example

Input


5
3
1 -1 0
1 1 -2
3
0 1 1
0 2 2
2
1 0
1 41
2
-1 0
-1 -41
5
0 1 -1 1 -1
1 1 -1 1 -1


Output


YES
NO
YES
YES
NO

Note

In the first test-case we can choose (i, j)=(2, 3) twice and after that choose (i, j)=(1, 2) twice too. These operations will transform [1, -1, 0] → [1, -1, -2] → [1, 1, -2]

In the second test case we can't make equal numbers on the second position.

In the third test case we can choose (i, j)=(1, 2) 41 times. The same about the fourth test case.

In the last lest case, it is impossible to make array a equal to the array b.
import javafx.util.Pair;
 
import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.util.*;
import java.util.Map.Entry;

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.InputMismatchException;
 
public class abc {
		
		public static void main(String[] args) throws Exception {
			// TODO Auto-generated method stub
			InputReader s = new InputReader(System.in);
			PrintWriter p = new PrintWriter(System.out);
			int t = s.nextInt();
			while (t-- > 0) {
				int n=s.nextInt();
				int[] arr1=new int[n];
				int[] arr2=new int[n];
				for(int i=0 ; i<arr1.length ; i++) {
					arr1[i]=s.nextInt();
				}
				for(int i=0 ; i<arr2.length ; i++) {
					arr2[i]=s.nextInt();
				}
				boolean z=helper(arr1,arr2);
				if(z) {
					p.println("YES");
				}else {
					p.println("NO");
				}
			}
			p.flush();
			p.close();
		}
	 
		
		
		public static boolean helper(int[] arr1 , int[] arr2) {
			boolean[] temp=new boolean[3];
			if(arr1.length==0) return true;
			if(arr1[0]!=arr2[0]) return false;
			temp[arr1[0]+1]=true;
			for(int i=1 ; i<arr1.length ; i++) {
				
				if(arr1[i]==arr2[i]) {
					
				}else if(arr1[i]<arr2[i]) {
					if(!temp[2]) {
						return false;
					}
				}else {
					if(!temp[0]) {
						return false;
					}
				}
				temp[arr1[i]+1]=true;
			}
			return true;
		}
		
		
		
		static class Pair<T, V> {
			T first; // maximum distance Node
			V second; // distance of maximum distance node
	 
			// Constructor
			Pair(T first, V second) {
				this.first = first;
				this.second = second;
			}
		}
	 
		public static ArrayList Divisors(long n) {
			ArrayList<Long> div = new ArrayList<>();
	 
			for (long i = 1; i <= Math.sqrt(n); i++) {
				if (n % i == 0) {
					div.add(i);
	 
					if (n / i != i)
						div.add(n / i);
				}
			}
			return div;
		}
	 
		public static int BinarySearch(long[] a, long k) {
			int n = a.length;
			int i = 0, j = n - 1;
			int mid = 0;
	 
			if (k < a[0])
				return 0;
			else if (k >= a[n - 1])
				return n;
			else {
				while (j - i > 1) {
					mid = (i + j) / 2;
	 
					if (k >= a[mid])
						i = mid;
					else
						j = mid;
				}
			}
	 
			return i + 1;
		}
	 
		public static long GCD(long a, long b) {
			if (b == 0)
				return a;
			else
				return GCD(b, a % b);
		}
	 
		public static long LCM(long a, long b) {
			return (a * b) / GCD(a, b);
		}
	 
		static class InputReader {
	 
			private final InputStream stream;
			private final byte[] buf = new byte[8192];
			private int curChar, snumChars;
			private SpaceCharFilter filter;
	 
			public InputReader(InputStream stream) {
				this.stream = stream;
			}
	 
			public int snext() {
				if (snumChars == -1)
					throw new InputMismatchException();
				if (curChar >= snumChars) {
					curChar = 0;
					try {
						snumChars = stream.read(buf);
					} catch (IOException e) {
						throw new InputMismatchException();
					}
					if (snumChars <= 0)
						return -1;
				}
				return buf[curChar++];
			}
	 
			static class pair implements Comparable<pair> {
				Integer x, y;
	 
				pair(int x, int y) {
					this.x = x;
					this.y = y;
				}
	 
				public int compareTo(pair o) {
					int result = x.compareTo(o.x);
					if (result == 0)
						result = y.compareTo(o.y);
	 
					return result;
				}
	 
				public String toString() {
					return x + " " + y;
				}
	 
				public boolean equals(Object o) {
					if (o instanceof pair) {
						pair p = (pair) o;
						return p.x - x == 0 && p.y - y == 0;
					}
					return false;
				}
	 
				public int hashCode() {
					return new Long(x).hashCode() * 31 + new Long(y).hashCode();
				}
			}
	 
			public int nextInt() {
				int c = snext();
				while (isSpaceChar(c)) {
					c = snext();
				}
				int sgn = 1;
				if (c == '-') {
					sgn = -1;
					c = snext();
				}
				int res = 0;
				do {
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					res *= 10;
					res += c - '0';
					c = snext();
				} while (!isSpaceChar(c));
				return res * sgn;
			}
	 
			public long nextLong() {
				int c = snext();
				while (isSpaceChar(c)) {
					c = snext();
				}
				int sgn = 1;
				if (c == '-') {
					sgn = -1;
					c = snext();
				}
				long res = 0;
				do {
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					res *= 10;
					res += c - '0';
					c = snext();
				} while (!isSpaceChar(c));
				return res * sgn;
			}
	 
			public int[] nextIntArray(int n) {
				int a[] = new int[n];
				for (int i = 0; i < n; i++) {
					a[i] = nextInt();
				}
				return a;
			}
	 
			public String readString() {
				int c = snext();
				while (isSpaceChar(c)) {
					c = snext();
				}
				StringBuilder res = new StringBuilder();
				do {
					res.appendCodePoint(c);
					c = snext();
				} while (!isSpaceChar(c));
				return res.toString();
			}
	 
			public String nextLine() {
				int c = snext();
				while (isSpaceChar(c))
					c = snext();
				StringBuilder res = new StringBuilder();
				do {
					res.appendCodePoint(c);
					c = snext();
				} while (!isEndOfLine(c));
				return res.toString();
			}
	 
			public boolean isSpaceChar(int c) {
				if (filter != null)
					return filter.isSpaceChar(c);
				return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
			}
	 
			private boolean isEndOfLine(int c) {
				return c == '\n' || c == '\r' || c == -1;
			}
	 
			public interface SpaceCharFilter {
				public boolean isSpaceChar(int ch);
			}
		}
	 
		static class CodeX {
			public static void sort(long arr[]) {
				merge_sort(arr, 0, arr.length - 1);
			}
	 
			private static void merge_sort(long A[], long start, long end) {
				if (start < end) {
					long mid = (start + end) / 2;
					merge_sort(A, start, mid);
					merge_sort(A, mid + 1, end);
					merge(A, start, mid, end);
				}
	 
			}
	 
			private static void merge(long A[], long start, long mid, long end) {
				long p = start, q = mid + 1;
				long Arr[] = new long[(int) (end - start + 1)];
				long k = 0;
	 
				for (int i = (int) start; i <= end; i++) {
					if (p > mid)
						Arr[(int) k++] = A[(int) q++];
	 
					else if (q > end)
						Arr[(int) k++] = A[(int) p++];
	 
					else if (A[(int) p] < A[(int) q])
						Arr[(int) k++] = A[(int) p++];
	 
					else
						Arr[(int) k++] = A[(int) q++];
				}
				for (int i = 0; i < k; i++) {
					A[(int) start++] = Arr[i];
				}
	 
			}
	 
		}
	 
	}

	
