Define matrix , if for every m(1 ≤ m ≤ n),
then matrix A can be called as partially negative matrix. Here matrix
, and {i
1,..,i
m} is a sub set of {1,..,n}.If you are not familiar with determinant of a matrix, please read the Note part of this problem.
For example, matrix is a partially negative matrix because |-2|, |-6| andare negative.
A symmetric matrix is a square matrix that equals to its transpose. Formally, matrix A is symmetric if A = A
T. For example, is a symmetric matrix.
Given two N-dimensional vector x and b, and we guarantee that there will be at least
one 0 value in vector b. You task is to judge if there exists a symmetric partially
negative matrix A, which fulfills A
x = b.
There are several test cases. Proceed to the end of file.
Each test case is described in three lines.
The first line contains one integer N (2 ≤ N ≤ 100000) .
The second line contains N integers x
i (-1000000 < x
i < 1000000, 1 ≤ i ≤ N), which is vector x.
The third line contains N integers b
i (-1000000 < b
i < 1000000, 1 ≤ i ≤ N), which is vector b. There will be at least one b
i which equals to zero.
For each test case, output “Yes” if there exists such a matrix A, or “No” if there is no such matrix.