409245: GYM103466 H Prince and Princess

Memory Limit:512 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

H. Prince and Princesstime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard output

Prince Mochi of the Mochi Kingdom falls in love with Princess Tofu of the Tofu Kingdom, but the queen of the Tofu Kingdom does not assent to this marriage.

The queen challenges their love and advocates a task for Prince Mochi. Solving this task is the premise for earning their happiness. The lack of capacity obliges Prince Mochi to ask you for help.

Here is the task: Princess Tofu, King Tofu, the queen, the minister, maids, chefs, and many others are all together for the task, all staying in separate rooms. Note that there is no empty room. Each one of them knows where he/she is and where any other people are.

Prince Mochi is asked to find the princess. He can inquire anyone about the following three types of questions:

  • Who are you?
  • Who is staying in a specified room?
  • Which room does the Princess Tofu stay in?

They will never refuse to answer the questions, but may not tell the truth. People, including Princess Tofu herself, who support this marriage will present the facts. The opposition, like the queen, will always provide an incorrect answer. Other participants will be arbitrary.

Prince Mochi does not want to spend too much time and so he will query as little as possible. Can you tell him the minimum number of questions he really needs to confirm where his darling is under any circumstances? But sometimes, the task is impossible, then you should also remind him to begin a new love affair.

Input

The only line in input contains three integers $$$a~(1 \le a \le 2 \times 10^5)$$$, $$$b$$$ and $$$c~(0 \le b,c \le 2 \times 10^5)$$$ which represent the number of participants who support this marriage, who are against this marriage and who do not really care about it respectively.

Output

If it is impossible to determine where Prince Mochi is, output "NO" (without quotes). Otherwise, output "YES" (without quotes) at first following an integer indicating the minimum number of questions the prince needs to inquire in the second line.

ExamplesInput
2 0 0
Output
YES
1
Input
1 1 0
Output
NO
Note

In the second sample case, Prince Mochi may ask all available questions to both participants. However, in the case when they always provide the same answer, the prince cannot ensure where the princess is. Thus the answer is "NO".

加入题单

上一题 下一题 算法标签: