atcoder#ABC200D. [ABC200D] Happy Birthday! 2
[ABC200D] Happy Birthday! 2
Score : points
Problem Statement
You are given a sequence of positive integers: . Determine whether there is a pair of sequences $B = (B_1, B_2, \dots, B_x), C = (C_1, C_2, \dots, C_y)$ satisfying all of the conditions, and print one such pair if it exists.
- .
- .
- .
- and are different sequences.- Here, we consider and different when or there is an integer such that .
- and are equal modulo .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
If there is no pair of sequences satisfying the conditions, print a single line containing No
.
Otherwise, print your choice of and in the following format:
Yes
The checker is case-insensitive: you can use either uppercase or lowercase letters.
5
180 186 189 191 218
Yes
1 1
2 3 4
For , we have , which are equal modulo . There are other solutions that will also be accepted, such as:
yEs
4 2 3 4 5
3 1 2 5
2
123 523
Yes
1 1
1 2
6
2013 1012 2765 2021 508 6971
No
If there is no pair of sequences satisfying the conditions, print a single line containing No
.