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.
def solve(test_case):
    n = read(int)
    A = read([int])
    B = read([int])
    has1 = False
    hasn1 = False
    for a, b in zip(A, B):
        diff = b - a
        if diff > 0 and not has1:
            return print('NO')
        if diff < 0 and not hasn1:
            return print('NO')
        has1 |= (a == 1)
        hasn1 |= (a == -1)
    print('YES')


def dp(f):
    cache = {}

    def g(*args):
        args = tuple(args)
        if args in cache:
            return cache[args]
        x = f(*args)
        cache[args] = x
        return x

    return g


MOD = 10 ** 9 + 7


class Config:
    has_tests = True
    debug = False
    print_recursion = False
    prime_sieve = 1


import itertools
import math
from collections import defaultdict
from collections import namedtuple
from heapq import heapify, heappop, heappush, heappushpop, heapreplace


def trie():
    return defaultdict(trie)


def _():
    print(heapify, heappop, heappush, heappushpop, heapreplace, namedtuple, math, itertools)


def is_prime(n):
    if n < 2: return False
    if n == 2: return True
    if n <= Config.prime_sieve:
        return spf[n] == n
    f = 3
    while f * f <= n:
        if n % f == 0:
            return False
    return True


def prime_factorize(n):
    if n <= 3:
        return [(n, 1)]
    factorization = []
    f = 2
    while f * f <= n > Config.prime_sieve:
        p = 0
        while n % f == 0:
            p += 1
            n //= f
        factorization.append((f, p))
        f += 1
    while 1 < n != spf[n]:
        p = 0
        f = spf[n]
        while n % f == 0:
            n //= f
            p += 1
        factorization.append((f, p))
    if n > 1:
        factorization.append((n, 1))
    return factorization


def count_factors(factorization, mod=None):
    ans = 1
    for f, p in factorization:
        ans *= 1 + p
        if mod is not None:
            ans %= mod
    return ans


def sum_of_factors(n, mod=None):
    pass


def ncr(n, r, mod=None):
    pass


def pow(n, p, mod=None):
    ans = 1
    while p > 0:
        if p % 2 == 1:
            ans *= n
            if mod is not None:
                ans %= mod
        n *= n
        if mod is not None:
            n %= mod
        p //= 2
    return ans


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def x_gcd(a, b):
    """:return: (g, x, y) where ax + my = g = gcd(a, b)"""
    px, x = 1, 0
    py, y = 0, 1
    while b:
        q = a // b
        x, px = px - q * x, x
        y, py = py - q * y, y
        a, b = b, a % b
    return a, px, py


def mod_inv(n, m):
    """:return: mod inv of n, if exists. Otherwise, returns (x, g) where g = gcd(n, m) and x = mod inv of n"""
    g, x, y = x_gcd(n, m)
    if g == 1:
        return x % m
    return x % m, g


def mod_inv_multi(n, m):
    """:return: mod inverses of all numbers till n. (m must be prime)"""
    inv = [1] * (n + 1)
    for i in range(2, m):
        inv[i] = (m - ((m // i) * inv[m % i]) % m) % m
    return inv


def read(typ, times=None, delimiter=None):
    if times is not None:
        return [read(typ, times=None, delimiter=delimiter) for _ in range(times)]
    if isinstance(typ, list):
        return list(map(typ[0], input().strip().split(delimiter)))
    return typ(input().strip())


class BBST:
    pass


class SegmentTree:
    def __init__(self, values, combinator, updater):
        self.original = values
        self.combinator = combinator
        self.updater = updater

        n = len(values)
        tree = [] * (4 * n)

        for i, val in enumerate(values):
            tree[n + i] = val
        for i in reversed(range(n)):
            tree[i] = combinator(tree[2 * i], tree[2 * i + 1])
        self._tree = tree

    def query(self, start, end):
        combinator = self.combinator
        updater = self.updater
        tree = self._tree
        n = len(tree)
        start += n
        end += n

        pass

    def update(self, start, end, value):
        combinator = self.combinator
        updater = self.updater
        tree = self._tree
        n = len(tree)
        pass


class DisjointSet:
    def __init__(self):
        self._parents = {}
        self._rank = defaultdict(lambda: 1)

    def find(self, x):
        parent = self._parents.get(x, x)
        while parent != x:
            grand = self._parents.get(parent, parent)
            x, parent, self._parents[x] = parent, grand, grand
        return parent

    def rank(self, x):
        return self._rank[self.find(x)]

    def merge(self, x, y):
        x, y = self.find(x), self.find(y)
        if self.rank(x) < self.rank(y):
            x, y = y, x
        self._parents[y] = x
        self._rank[x] += self._rank[y]
        del self._rank[y]


def sieve(n):
    global spf
    spf = [i for i in range(n + 1)]
    spf[0], spf[1] = 2, -1
    i = 2
    while i * i <= n:
        if spf[i] == i:
            for j in range(i * i, n + 1, i):
                if i < spf[j]:
                    spf[j] = i
        i += 1


def main():
    if Config.prime_sieve is not None:
        sieve(Config.prime_sieve)
    if Config.has_tests:
        for t in range(read(int)):
            solve(t)
    else:
        solve(None)


if __name__ == '__main__':
    spf = []
    main()
