← Return

Number Line JumpsEasy

You are choreographing a circus show with various animals. For one act, you are given two kangaroos on a number line ready to jump in the positive direction (i.e, toward positive infinity).

You have to figure out a way to get both kangaroos at the same location at the same time as part of the show. If it is possible, return YES, otherwise return NO.

Example

\(x1 = 2\)

\(v1 = 1\)

\(x2 = 1\)

\(v2 = 2\)

After one jump, they are both at \(x = 3, (x1 + v1 = 2 + 1, x2 + v2 = 1 + 2)\), so the answer is YES.