100 atcoder#ABC209B. [ABC209B] Can you buy them all?
[ABC209B] Can you buy them all?
Score : points
Problem Statement
Takahashi's shop sells products. The usual price of the -th product is yen (Japanese currency). It has a bargain sale today, with a discount of yen off the usual prices for the -nd, -th, and the subsequent even-indexed products. The -st, -rd, and the subsequent odd-indexed products are sold for their usual prices. You have yen. Can you buy all the products with this money?
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
If you can buy all the products, print Yes
; otherwise, print No
.
2 3
1 3
Yes
You can buy the -st product for yen and the -nd product for yen, yen off the usual price. You have just enough money, yen, to buy both of them.
4 10
3 3 4 4
No
You can buy these four products for yen, yen, yen, and yen, respectively. You need yen to buy all of them, and since you have only yen, you cannot buy all of them.
8 30
3 1 4 1 5 9 2 6
Yes