[SDCPC 2023] Three Dice

Luogu
IDLGP9564
Time1000ms
Memory1024MB
DifficultyP1
2023山东O2优化枚举省赛/邀请赛
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$. ## Input 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 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`. [samples] ## Note In the first example, one possible solution is $4, 2, 3$. In the second example, one possible solution is $1, 1, 1$.
Samples
Input #1
4 5
Output #1
Yes
Input #2
3 0
Output #2
Yes
Input #3
1 2
Output #3
No
API Response (JSON)
{
  "problem": {
    "name": "[SDCPC 2023] Three Dice",
    "description": {
      "content": "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",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 1048576
    },
    "difficulty": {
      "LuoguStyle": "P1"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP9564"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "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.\n\n![](https...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments