#P9203. 时效「月岩笠的诅咒」
时效「月岩笠的诅咒」
Background
The Hourai Elixir, a cursed elixir of immortality.
Tsukiiwakasa, who was ordered to throw the Hourai Elixir into Mount Fuji to destroy it, eventually planned to throw the Hourai Elixir into the Yatsugatake Mountains instead. On the way down the mountain, Mokou kicked it down the slope and seized the Hourai Elixir.
That was already a thousand years ago.
Problem Description
The times at which two events happened on the timeline can be viewed as two real numbers . We say the two events satisfy the “anniversary” relation if and only if we can make them equal by performing the following two operations (possibly times):
- Add to , i.e., .
- Add to , i.e., .
Now you are given real numbers . Determine whether they satisfy “anniversary”.
Input Format
The input consists of one line with two real numbers . The input is given with exactly digits after the decimal point.
Output Format
Output one line. If a valid way exists, output ; otherwise output .
100.000000000000 999999.000000000000
YES
114.123456789000 514.123456789000
YES
0.333333333333 0.333333333334
NO
Hint
For all testdata, it is guaranteed that .
Translated by ChatGPT 5