Cubelover

Time limit1sMemory limit128 MB

Problem

Jihak is a well-known cubelover: he loves cubic polynomials.

One sunny spring day, Jihak spotted Seunghyun playing with an integer sequence $x_1, x_2, \ldots, x_n$ of length $n$ at the apartment-complex playground. Jihak was the boss of that apartment complex, and he was Seunghyun's elder brother in spirit, born a full 45 days before him. The moment Jihak saw Seunghyun, he snatched the sequence away.

Seunghyun broke down crying on the spot. His heart softening, Jihak promised to return the sequence if Seunghyun could find real numbers $a$, $b$, $c$, $d$ such that

$$x_i = a i^3 + b i^2 + c i + d$$

holds for every integer $i$ with $1 \le i \le n$. (Strictly speaking a cubic polynomial requires $a \ne 0$, but Jihak does not seem to want to be that strict, so $a = 0$ is allowed as well.)

Out enjoying a rare day away from school, you met eyes with the sobbing Seunghyun. He ran straight up to you and begged you to find such real numbers $a$, $b$, $c$, $d$ as quickly as possible. Can you wipe away Seunghyun's tears?

Input

The input contains several test cases. The first line contains the number of test cases $T$ ($1 \le T \le 1000$).

Each of the next $T$ lines describes one test case. It begins with an integer $n$ ($1 \le n \le 500$), the length of the sequence, followed by $n$ integers; the $i$-th of them is $x_i$ ($0 \le x_i \le 50,000,000$).

Output

For each test case, print YES if real numbers $a$, $b$, $c$, $d$ satisfying $x_i = a i^3 + b i^2 + c i + d$ exist, and NO otherwise. Print one answer per line.

Hint

In the first test case, one possible answer is $a = 0$, $b = 0$, $c = 0$, $d = 3$.