#P9564. [SDCPC 2023] Three Dice

[SDCPC 2023] Three Dice

题目描述

Dice are small, throwable objects with marked sides capable of landing in multiple positions. They are typically used to generate random values, especially in the context of tabletop games.

The most common dice are small cubes, with faces numbered from 11 to 66. Number nn (1n61 \le n \le 6) is usually represented by a pattern of nn round dots, known as pips. Moreover, the pips on the 11 and 44 faces are colored red, while those on the 22, 33, 55 and 66 faces are black.

Little Cyan Fish has three dice. One day, he threw them onto a table, and then observed the uppermost faces. He claimed that the total number of the red pips facing up was exactly AA, and the total number of the black pips facing up was exactly BB.

However, you find his claim doubtful. You want to verify whether it is possible to throw three dice such that the total number of red pips facing up is AA, and the total number of black pips facing up is BB.

输入格式

There is only one test case in each test file.

The first line of the input contains two integers AA and BB (0A,B1000 \leq A,B \leq 100), indicating the total number of red pips facing up and the number of black pips facing up.

输出格式

Output one line. If it is possible for Little Cyan Fish to throw three dice such that the total number of red pips facing up is AA, and the total number of black pips facing up is BB output Yes. Otherwise output No.

4 5

Yes

3 0

Yes

1 2

No

提示

In the first example, one possible solution is 4,2,34, 2, 3.

In the second example, one possible solution is 1,1,11, 1, 1.