题目描述
Problem Statement
There is an infinitely long piano keyboard.
Is there a continuous segment within this keyboard that consists of W white keys and B black keys?
Let S be the string formed by infinitely repeating the string wbwbwwbwbwbw.
Is there a substring of S that consists of W occurrences of w and B occurrences of b?
What is a substring of S?
A substring of S is a string that can be formed by concatenating the $l-th, (l+1)-th, \dots, r-th$ characters of S in this order for some two positive integers l and $r (l\leq r)$.
Input
The input is given from Standard Input in the following format:
W B
Output
If there is a substring of S that consists of W occurrences of w and B occurrences of b, print Yes; otherwise, print No.
Constraints
- W and B are integers.
- $0\leq W,B \leq 100$
- $W+B \geq 1$
Sample Input 1
3 2
Sample Output 1
Yes
The first 15 characters of S are wbwbwwbwbwbwwbw. You can take the 11-th through 15-th characters to form the string bwwbw, which is a substring consisting of three occurrences of w and two occurrences of b.
Sample Input 2
3 0
Sample Output 2
No
The only string consisting of three occurrences of w and zero occurrences of b is www, which is not a substring of S.
Sample Input 3
92 66
Sample Output 3
Yes
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分