#P1028E. Restore Array
Restore Array
No submission language available for this problem.
Description
While discussing a proper problem A for a Codeforces Round, Kostya created a cyclic array of positive integers . Since the talk was long and not promising, Kostya created a new cyclic array so that , where we take . Here is the modulo operation. When the talk became interesting, Kostya completely forgot how array had looked like. Suddenly, he thought that restoring array from array would be an interesting problem (unfortunately, not A).
The first line contains a single integer () — the length of the array .
The second line contains integers ().
If it is possible to restore some array of length so that holds for all , print «YES» in the first line and the integers in the second line. All should satisfy . We can show that if an answer exists, then an answer with such constraint exists as well.
It it impossible to restore any valid , print «NO» in one line.
You can print each letter in any case (upper or lower).
Input
The first line contains a single integer () — the length of the array .
The second line contains integers ().
Output
If it is possible to restore some array of length so that holds for all , print «YES» in the first line and the integers in the second line. All should satisfy . We can show that if an answer exists, then an answer with such constraint exists as well.
It it impossible to restore any valid , print «NO» in one line.
You can print each letter in any case (upper or lower).
Samples
Note
In the first example: