CF305B Continued Fractions
Description
A continued fraction of height $ n $ is a fraction of form . You are given two rational numbers, one is represented as  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 .
In the second sample .
In the third sample .