cswork / OA打开练习工作台

Goldman SachsOA #26

Is Possible

估计中等可在线判题

考点(AI 标注)位运算

Starting from a pair of positive integers (a,b), you may repeatedly apply (a,b)→(a+b,b) or (a,b)→(a,a+b). Determine whether the target pair of positive integers (c,d) can be obtained; zero operations are allowed.

输入格式

A single line containing a b c d. Original range: 1≤a,b,c,d≤1000.

输出格式

Output Yes if reachable, otherwise output No.

样例 1

输入:

1 1 3 2

输出:

Yes

样例 2

输入:

2 3 5 8

输出:

Yes

样例 3

输入:

1 2 2 2

输出:

No