#abc209b. B - Can you buy them all?

B - Can you buy them all?

Score : 200200 points

问题描述

高桥商店销售 NN 种产品。第 ii 个产品的常规价格是 AiA_i 日元(日本货币)。

今天商店举行特价促销,对于第 2244 项以及随后所有偶数序号的产品,每件优惠 11 日元。而第 1133 项以及随后所有奇数序号的产品按原价销售。

你现在拥有 XX 日元。请问,你能否用这些钱购买全部 NN 种产品呢?

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

Takahashi's shop sells NN products. The usual price of the ii-th product is AiA_i yen (Japanese currency).
It has a bargain sale today, with a discount of 11 yen off the usual prices for the 22-nd, 44-th, and the subsequent even-indexed products. The 11-st, 33-rd, and the subsequent odd-indexed products are sold for their usual prices.
You have XX yen. Can you buy all the NN products with this money?

Constraints

  • 1N1001 \leq N \leq 100
  • 1X100001 \leq X \leq 10000
  • 1Ai1001 \leq A_i \leq 100
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN XX

A1A_1 A2A_2 \ldots ANA_N

Output

If you can buy all the NN products, print Yes; otherwise, print No.

Sample Input 1

2 3
1 3

Sample Output 1

Yes

You can buy the 11-st product for 11 yen and the 22-nd product for 22 yen, 11 yen off the usual price. You have just enough money, 33 yen, to buy both of them.

Sample Input 2

4 10
3 3 4 4

Sample Output 2

No

You can buy these four products for 33 yen, 22 yen, 44 yen, and 33 yen, respectively. You need 1212 yen to buy all of them, and since you have only 1010 yen, you cannot buy all of them.

Sample Input 3

8 30
3 1 4 1 5 9 2 6

Sample Output 3

Yes

update @ 2024/3/10 09:22:29