atcoder#ARC152A. [ARC152A] Seat Occupation

[ARC152A] Seat Occupation

Score : 400400 points

Problem Statement

There is a row of LL chairs. Now, NN groups of people will come and take seats in order. Each group consists of one or two people, and the ii-th group to come consists of aia_i people. The total number of people equals LL.

Each group will randomly choose unoccupied chairs where all group members can sit consecutively, and occupy those chairs. However, if there are not enough consecutive unoccupied chairs, they will leave without taking seats.

Determine whether it is guaranteed that all NN groups can take seats.

Constraints

  • 1N2×1051\leq N\leq 2\times 10^5
  • 1ai21\leq a_i\leq 2
  • L=a1+a2++aNL=a_1 +a_2 +\ldots +a_N
  • All values in the input are integers.

Input

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

NN LL

a1a_1 a2a_2 \ldots aNa_N

Output

If it is guaranteed that all NN groups can take seats, print Yes; otherwise, print No.

2 4
2 2
No

Let us number the chairs 11, 22, 33, 44 from left to right. If the first group of two people takes chairs 22 and 33, the next group of two people cannot take seats and will leave. Thus, it is not guaranteed that all NN groups can take seats, so you should print No.

3 4
1 2 1
Yes

No matter what chairs they choose, everyone can always take a seat.