
128  The 2013 ACMICPC Asia Changsha Regional Contest  E
Define matrix A ∈ R^{n × n}, 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 subset 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 and are 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 Ndimensional vector x and b, and we guarantee that there will be at least one 0 value in vector b. Your task is to judge if there exists a symmetric partially negative matrix A, which fulfills Ax = b. Input
There are several test cases. Proceed to the end of file. OutputFor each test case, output “Yes” if there exists such a matrix A, or “No” if there is no such matrix. Sample Input2 2 1 0 6 Samlpe OutputYes HintThere exists a symmetric partially negative matrix . NoteDeterminant of an n × n matrix A is defined as below: Here the sum is computed over all permutations σ of the set {1, 2, ..., n}. A permutation is a function that reorders this set of integers. The value in the ith position after the reordering σ is denoted σ_{i}. For example, for n = 3, the original sequence 1, 2, 3 might be reordered to σ = [2, 3, 1], with σ_{1} = 2, σ_{2} = 3, and σ_{3} = 1. The set of all such permutations (also known as the symmetric group on n elements) is denoted S_{n}. For each permutation σ, sgn(σ) denotes the signature of σ, a value that is +1 whenever the reordering given by σ can be achieved by successively interchanging two entries an even number of times, and −1 whenever it can be achieved by an odd number of such interchanges. Author: WU, Hao 