#abc347c. C - Ideal Holidays
C - Ideal Holidays
Score: points
问题陈述
在AtCoder王国,一周由天组成,前天是假期,第天到第天是工作日。
高桥有个计划,第个计划安排在天后。
他忘记了今天是周几。请确定他的所有个计划是否都可能安排在假期。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
In the Kingdom of AtCoder, a week consists of days, with the first through -th days being holidays and the -th through -th being weekdays.
Takahashi has plans, and the -th plan is scheduled days later.
He has forgotten what day of the week it is today. Determine if it is possible for all of his plans to be scheduled on holidays.
Constraints
Input
The input is given from Standard Input in the following format:
Output
Print Yes
in a single line if it is possible for all of Takahashi's plans to be scheduled on holidays, and No
otherwise.
Sample Input 1
3 2 5
1 2 9
Sample Output 1
Yes
In this input, a week consists of seven days, with the first through second days being holidays and the third through seventh days being weekdays.
Let us assume today is the seventh day of the week. In this case, one day later would be the first day of the week, two days later would be the second day of the week, and nine days later would also be the second day of the week, making all plans scheduled on holidays. Therefore, it is possible for all of Takahashi's plans to be scheduled on holidays.
Sample Input 2
2 5 10
10 15
Sample Output 2
No
Sample Input 3
4 347 347
347 700 705 710
Sample Output 3
Yes