P9203 Time Limit “The Curse of Tsukiiwakasa”
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.
Description
The times at which two events happened on the timeline can be viewed as two real numbers $a, b$. 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 $0$ times):
- Add $1$ to $a$, i.e., $a \gets a + 1$.
- Add $1$ to $b$, i.e., $b \gets b + 1$.
Now you are given real numbers $a, b$. Determine whether they satisfy “anniversary”.
Input Format
The input consists of one line with two real numbers $a, b$. The input is given with exactly $12$ digits after the decimal point.
Output Format
Output one line. If a valid way exists, output $\verb!YES!$; otherwise output $\verb!NO!$.
Explanation/Hint
For all testdata, it is guaranteed that $0 < a, b \le 10^9$.
Translated by ChatGPT 5