#abc347c. C - Ideal Holidays

C - Ideal Holidays

Score: 350350 points

问题陈述

在AtCoder王国,一周由A+BA+B天组成,前AA天是假期,第(A+1)(A+1)天到第(A+B)(A+B)天是工作日。

高桥有NN个计划,第ii个计划安排在DiD_i天后。

他忘记了今天是周几。请确定他的所有NN个计划是否都可能安排在假期。

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

In the Kingdom of AtCoder, a week consists of A+BA+B days, with the first through AA-th days being holidays and the (A+1)(A+1)-th through (A+B)(A+B)-th being weekdays.

Takahashi has NN plans, and the ii-th plan is scheduled DiD_i days later.

He has forgotten what day of the week it is today. Determine if it is possible for all of his NN plans to be scheduled on holidays.

Constraints

  • 1N2×1051\leq N\leq 2\times 10^5
  • 1A,B1091\leq A,B\leq 10^9
  • 1D1<D2<<DN1091\leq D_1<D_2<\ldots<D_N\leq 10^9

Input

The input is given from Standard Input in the following format:

NN AA BB

D1D_1 D2D_2 \ldots DND_N

Output

Print Yes in a single line if it is possible for all of Takahashi's NN 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 NN 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