Ordinary graph coloring is a well-known problem. Hyeongjin got bored of it and invented a new coloring rule called super coloring.
A super coloring of a graph assigns a color to each vertex and must satisfy the following conditions for every two distinct vertices .
- If and are connected by an edge, their colors must be different.
- If and are not connected by an edge, their colors must be the same.
Hyeongjin also decided to define a new graph operation. Given a graph, its complement graph is obtained by removing every edge that originally existed and adding every edge that originally did not exist. Self-loops are not considered.
Hyeongjin wants to know whether the complement graph of the given graph can be super-colored using only colors.
Determine whether it is possible, and if it is possible, output one valid coloring.
Input
The input is given in the following format.
The given graph is a simple undirected graph with vertices and edges. The vertices are numbered from to .
Output
If the complement graph can be super-colored, print yes on the first line. Otherwise, print no.
If it is possible, print integers on the second line. is the color of vertex , and must be one of , , and .
If there are multiple valid colorings, you may print any of them.
Constraints
- .
- .
- .
- .
- No edge appears more than once.
Subtasks
Samples
In the complement graph, adjacent vertices have different colors, and non-adjacent vertices have the same color.
There is no coloring satisfying the conditions.
The original graph has no edges, so its complement is the complete graph on vertices. It requires distinct colors, so colors are not enough.
해설
관리자가 작성한 해설을 별도 페이지에서 볼 수 있어요.