[SDCPC2023] Three Dice
题意翻译
**【题目描述】**
骰子,是一种各面带有标记,以生成随机数的小型可投掷道具,通常用于桌上游戏。
![](https://cdn.luogu.com.cn/upload/image_hosting/dsezqcgm.png)
最常见的骰子是一种小正方体,每个面上被标记了从 $1$ 到 $6$ 的数字。数字 $n$($1 \le n \le 6$)通常由 $n$ 个小圆点组成的图案来表示,其中 $1$ 号与 $4$ 号面的小圆点是红色的,而 $2$, $3$, $5$ 与 $6$ 号面的小圆点是黑色的。
小青鱼手中有三只骰子。有一天,他将这三只骰子投掷在桌子上,并观察了朝上的那一个面。他发现所有朝上的面中,红色的点数之和恰好为 $A$,而黑色的点数之和恰好为 $B$。
然而,您对小青鱼的发现感到怀疑。您想要确认是否有可能投掷出三只骰子,使得所有朝上的面中,红色的点数之和恰好为 $A$,而黑色的点数之和恰好为 $B$。
**【输入格式】**
每个测试文件仅有一组测试数据。
第一行输入两个整数 $A$ 和 $B$($0 \leq A,B \leq 100$),表示朝上的红色点数之和与黑色点数之和。
**【输出格式】**
输出一行。如果小青鱼有可能投掷出三只骰子使得所有朝上的面中,红色的点数之和恰好为 $A$,而黑色的点数之和恰好为 $B$,则输出 `Yes`。否则输出 `No`。
**【样例解释】**
在第一组样例中,其中一种合法的方案为 $4, 2, 3$。
在第二组样例中,其中一种合法的方案为 $1, 1, 1$。
题目描述
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.
![](https://cdn.luogu.com.cn/upload/image_hosting/dsezqcgm.png)
The most common dice are small cubes, with faces numbered from $1$ to $6$. Number $n$ ($1 \le n \le 6$) is usually represented by a pattern of $n$ round dots, known as pips. Moreover, the pips on the $1$ and $4$ faces are colored red, while those on the $2$, $3$, $5$ and $6$ 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 $A$, and the total number of the black pips facing up was exactly $B$.
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 $A$, and the total number of black pips facing up is $B$.
输入输出格式
输入格式
There is only one test case in each test file.
The first line of the input contains two integers $A$ and $B$ ($0 \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 $A$, and the total number of black pips facing up is $B$ output `Yes`. Otherwise output `No`.
输入输出样例
输入样例 #1
4 5
输出样例 #1
Yes
输入样例 #2
3 0
输出样例 #2
Yes
输入样例 #3
1 2
输出样例 #3
No
说明
In the first example, one possible solution is $4, 2, 3$.
In the second example, one possible solution is $1, 1, 1$.