J. Triangles and Squares
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

The English statement was translated by AI and may be slightly different from the original Chinese statement. Please refer to the Chinese statement if you have any questions.

Little L broke into a mysterious underground palace.

On the tightly closed palace door, Little L saw an inscription telling him that to open the door he needs to construct several convex polyhedra whose surfaces are tiled only by regular triangles and squares of side length $$$1$$$, and that a total of $$$x$$$ regular triangles and $$$y$$$ squares must be used.

Over time the power of the door has weakened. Now you only need to answer whether there exists at least one construction scheme such that the constructed several convex polyhedra satisfy the above conditions.

Note:

  • A polyhedron is called convex if for any two points inside the polyhedron the segment joining them lies entirely inside the polyhedron.
  • Each face of a convex polyhedron may be composed of several squares and regular triangles.
Input

Each test file contains multiple test cases. The first line contains the number of test cases $$$T$$$ ($$$1 \leq T \leq 10^4$$$). The description of the test cases follows.

The first line of each test case contains two integers $$$x$$$ and $$$y$$$ ($$$0 \leq x, y \leq 10^{18}$$$), indicating the number of regular triangles and squares to be used.

Output

For each test case, output "Yes" if there exists at least one valid construction scheme for the given $$$x, y$$$, otherwise output "No".

Example
Input
5
4 6
4 10
2 3
0 0
0 5
Output
Yes
Yes
Yes
Yes
No