In the year 20XX, mankind is hit by an unprecedented crisis. The power balance between the sun and the moon was broken by the total eclipse of the sun, and the end is looming! To save the world, the secret society called "Sun and Moon" decided to perform the ritual to balance the power of the sun and the moon called "Ritual of Sun and Moon".
The ritual consists of "Ritual of Sun" and "Ritual of Moon". "Ritual of Moon" is performed after "Ritual of Sun". Members of the society are divided into two groups, "Messengers of Sun" and "Messengers of Moon". Each member has some offerings and magic power.
First, the society performs "Ritual of Sun". In this ritual, each member may sacrifice one offering. Only those members with at least one offering can do so, and others simply do not participate in this part. After the sacrifice, the member's magic power is multiplied by the original number of their offerings. Each participating member performs this sacrifice just once.
Second, the society performs "Ritual of Moon". In the ritual, each member sacrifices all remaining offerings. After the sacrifice, their magic power is multiplied by x^p. Here is the number of days from the eclipse (the eclipse is the 0th day) and is the number of offerings they sacrificed. Each member must perform this step just once.
After two rituals, all "Messengers of Sun" and "Messengers of Moon" give their magic power to the "magical reactor". If the total power of "Messengers of Sun" and the total power of "Messengers of Moon" are equal, the society will succeed in the ritual and save the world.
It is very expensive to perform "Ritual of Sun". The society may not be able to perform "Ritual of Sun" because of financial trouble. Please write a program to calculate the minimum number of days from the eclipse in which the society can succeed in the "Ritual of Sun and Moon," whether "Ritual of Sun" is performed or not. The society cannot perform the ritual on the day of eclipse (the 0-th day).
The format of the input is as follows.
N
O_1 P_1
…
O_N P_N
The first line contains an integer N that is the number of members of the society (0 \leq N \leq 1000).
Each of the following N lines contains two integers O_i (0 \leq O_i \leq 1000000000) and P_i (1 \leq |P_i| \leq 1000000000000000). O_i is the number of offerings of the -th member and |P_i| is the strength of their magic power. If P_i is a positive integer, the -th member belongs to "Messengers of Sun", otherwise they belong to "Messengers of Moon".
If there exists a number of days from the eclipse that satisfies the above condition, print the minimum number of days preceded by "Yes ". Otherwise print "No".
Of course, the answer must be a positive integer.
Example 1