N, K = int(input()), int(input())
g = gcd(N, K)
if divisible_2_5(K // g):
    print('YES')
else:
    print('NO')