Limits 1s, 512 MB

Imagine a graph of infinite nodes labelled with positive integers from 1 to \infty.

Take every pair of nodes that are labelled with prime numbers and multiply the two prime numbers. You will get a composite number. Draw an edge between the first prime number and the composite number. Then draw another edge between the second prime number and the composite number.

You will be given two numbers. You have to tell whether there is a path between these two numbers.

Input

The input will contain two integers AA and BB (1A,B1071 \le A, B \le 10^7).

Output

Print “Yes” (w/o quotes) if there is a path between AA and BB. Otherwise, print “No” (w/o quotes).

Sample

InputOutput
2 15
Yes

There is a path from 2 to 10 to 5 to 15.


Submit

Login to submit.

Statistics

71% Solution Ratio
EgorKulikovEarliest, 7M ago
pathanFastest, 0.0s
Imran02Lightest, 5.2 MB
RahulBepariShortest, 335B
Toph uses cookies. By continuing you agree to our Cookie Policy.