cswork / OA打开练习工作台

WeRideOA #5

Bot Movement Reachability (Two Move Types)

估计中等可在线判题

考点(AI 标注)位运算

A robot starts at positive integer coordinates (x1,y1) and can perform (x,y)→(x+y,y) or (x,y)→(x,x+y) any number of times. Determine whether it can reach (x2,y2).

The ranges of the start and end points and the two moves are precisely defined; this site specifies stdin/stdout.

输入格式

One line with four integers x1 y1 x2 y2 (each in 1..1000).

输出格式

Output Yes if reachable, otherwise output No.

样例 1

输入:

1 1 3 2

输出:

Yes

样例 2

输入:

1 1 2 2

输出:

No

样例 3

输入:

2 3 7 3

输出:

No