

Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 点
問題文
高橋商店では 個の商品が売られています。 番目の商品の定価は 円です。
今日はセールが行われており、偶数番目の商品は定価の 円引きの値段で買うことができます。奇数番目の商品は定価で売られています。
あなたの所持金は 円です。これら 個の商品を全て買うことができますか?
制約
- 入力は全て整数
入力
入力は以下の形式で標準入力から与えられる。
出力
個の商品を全て買うことができるなら Yes
、できないなら No
と出力せよ。
入力例 1Copy
2 3 1 3
出力例 1Copy
Yes
番目の商品は 円、 番目の商品は定価より 円引きの 円で買うことができます。あなたの所持金は 円なので、ちょうどの金額で 個の商品を全て買うことができます。
入力例 2Copy
4 10 3 3 4 4
出力例 2Copy
No
個の商品はそれぞれ 円、 円、 円、 円で買うことができます。 個の商品を全て買うためには 円必要ですが、あなたの所持金は 円なので全て買うことはできません。
入力例 3Copy
8 30 3 1 4 1 5 9 2 6
出力例 3Copy
Yes
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
.
Sample Input 1Copy
2 3 1 3
Sample Output 1Copy
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.
Sample Input 2Copy
4 10 3 3 4 4
Sample Output 2Copy
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.
Sample Input 3Copy
8 30 3 1 4 1 5 9 2 6
Sample Output 3Copy
Yes