Check If LCM Equals Product

Check If LCM Equals Product

Medium Computer Mathematics GCD/LCM & Euclid 27 views
Explanation Complexity

Problem Statement

Given a and b, print YES if lcm(a,b)=a*b (no overlap factors).

Input Format

Two integers a b.

Output Format

YES or NO.

Example

6 35
YES

Constraints

a,b>0

Input / Output Format

Input Format
Two integers a b.
Output Format
YES or NO.
Constraints
a,b>0

Examples

Input:
6 35
Output:
YES

Example Solution (Public)

Computer Mathematics
lcm=a/g*b. lcm==a*b iff gcd==1. So check gcd(a,b)==1.

Official Solution Code

lcm=a/g*b. lcm==a*b iff gcd==1. So check gcd(a,b)==1.
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.