You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
417 B

#include <stdio.h>
//学会辗转相除法求最大公约数
//https://blog.csdn.net/chen_zan_yu_/article/details/82943306
// 最大公约数
long long gcd(long long x,long long y)
{
long long z = y;
while(x%y!=0)
{
z = x%y;
x = y;
y = z;
}
return z;
}
int main(void) {
long long a, b, c;
scanf("%lld%lld", &a, &b);
c = gcd(a, b);
b = b / c;
if (c % b == 0)
printf("Yes\n");
else
printf("No\n");
return 0;
}