# URL : https://yukicoder.me/problems/no/1224 a, b = map(int, input().split()) a %= b if a == 0: print('No') exit(0) while b % 2 == 0: b //= 2 while b % 5 == 0: b //= 5 if b != 1: print('Yes') else: print('No')