CF305B Continued Fractions

Description

A continued fraction of height $ n $ is a fraction of form ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF305B/19ade84928d3d628a6e212b03adbbf8bc0856736.png). You are given two rational numbers, one is represented as ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF305B/ae456f9650d5b3ca46e54c303d07fec088f6ad5e.png) and the other one is represented as a finite fraction of height $ n $ . Check if they are equal.

Input Format

The first line contains two space-separated integers $ p,q $ $ (1

Output Format

Print "YES" if these fractions are equal and "NO" otherwise.

Explanation/Hint

In the first sample ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF305B/a7429bd0927ab226e00de904e1ba240c58b09318.png). In the second sample ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF305B/a01a984749367ddde5131c663127bc347e31f0a2.png). In the third sample ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF305B/4db9464841d1b99996f6c98f75df85058aee123f.png).