HMBY - Hablu Wants to Buy
In Hablu's country, there are 5 types of notes. $2, $4, $8, $16 and $32. He went to a shop, and wants to buy an item which costs $w. He has to pay exactly $w to the shopkeeper. Can he pay $w?
Hablu can break his notes in half, that is, he can break his one $32 notes to two $16 notes, a $16 can be broken into two $8 notes, and so on. Only $2 can't be broken into $1, because there are no $1 notes. He has A $2 notes, B $4 notes, C $8 notes, D $16 notes and E $32 notes. Your task is to find whether Hablu can pay $w using his notes.
Input
The first and only line contains positive integers A, B, C, D, E, w, separated by spaces.
Output
If Hablu can pay $w, print "YES", else print "NO".
Example
Input: 1 2 3 4 5 2 Output: YES
Constraints
(A+B+C+D+E) ≤ 109
w ≤ 107
hide comments
Ruhan Habib:
2015-11-07 06:33:04
Kumar Pratyash, yes it is :) |
|
Kumar Pratyaksh:
2015-11-07 02:23:47
easy....if u notice it...:-p |
Added by: | Ruhan Habib |
Date: | 2015-11-05 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 GOSU JS-MONKEY |
Resource: | Own Problem |