def divisors(N):
    U = int(N ** 0.5) + 1
    L = [i for i in range(1, U) if N % i == 0]
    return L + [N // i for i in reversed(L) if N != i * i]

A, B = map(int, input().split())
if any(d % B == 0 for d in divisors(A)):
    print("YES")
else:
    print("NO")