题意:现在给你一组多项式,给出一个中间状态,此时有些系数可能是确定的,有些系数可能是不确定的(用?表示),机器人和人将轮流为未知数设值(由于是中间状态所以当前第一个设值的人不一定是机器人),给你整数k,求人类在不管机器人如何设值的情况下,是否能让最终的f(k) = 0。
100 years have passed since the last victory of the man versus computer in Go. Technologies made a huge step forward and robots conquered the Earth! It's time for the final fight between human and robot that will decide the faith of the planet.
The following game was chosen for the fights: initially there is a polynomial
P(x)=anxn+an-1xn-1+...+a1x+a0,with yet undefined coefficients and the integer k. Players alternate their turns. At each turn, a player pick some index j, such that coefficient aj that stay near xj is not determined yet and sets it to any value (integer or real, positive or negative, 0 is also allowed). Computer moves first. The human will be declared the winner if and only if the resulting polynomial will be divisible by Q(x)=x-k.Polynomial P(x) is said to be divisible by polynomial Q(x) if there exists a representation P(x)=B(x)Q(x), where B(x) is also some polynomial.
Some moves have been made already and now you wonder, is it true that human can guarantee the victory if he plays optimally?
Output
Print "
Yes" (without quotes) if the human has winning strategy, or "
No" (without quotes) otherwise.
Note
In the first sample, computer set
a0 to
-1 on the first move, so if human can set coefficient
a1 to
0.5 and win.
In the second sample, all coefficients are already set and the resulting polynomial is divisible by
x-100, so the human has won.