Hide

Problem L
Staying Frosty

/problems/stayingfrosty/file/statement/en/img-0001.png
Fire Resistance, Minecraft Wiki

After getting everything needed from the nether, it’s time to get back to the portal and head back to the overworld. Unfortunately, Alex fell on the way back and was separated from her friends! She was able to make it back near the portal on her own, but a lava pool stands between her and her destination.

Due to some terrible luck, Alex has ended up with half a heart of health and no food. She isn’t able to take any more damage and she can’t heal! For some odd reason, Alex wants to challenge herself to get across the pool without using blocks...

Alex has a certain number of fire resistance potions in her inventory, and wants to know if it’s even possible to make it across, she doesn’t want to lose all those hard-earned blaze rods in the lava!

Each potion lasts 180 seconds. Assume that Alex takes the first potion right before entering the lava (without jumping for extra distance), and that she’s able to consume each consecutive potion instantaneously while swimming, wasting no time between potions. While swimming, she can travel two blocks per second. Once she gets to the end of the pool, she’s able to exit the lava and enter safe land instantaneously as well. So if her potion runs out just as she reaches land, she’s safe! Can she make it across?

Input

The input contains two space-separated integers, $w$ and $p$, where $w$ is the width of the lava pool in blocks, and $p$ is the number of fire resistance potions Alex has. It is given that $5 \le w \le 10^6$ and $0 \le p \le 3000$.

Output

If Alex can make it safely across the lava pool, output ’YES’. Otherwise, output ’NO’.

Sample Input 1 Sample Output 1
300 1
YES
Sample Input 2 Sample Output 2
3750 10
NO
Sample Input 3 Sample Output 3
721 2
NO

Please log in to submit a solution to this problem

Log in