def divisor(N): ass = [] for i in range(1, int(N ** 0.5) + 1): if N % i == 0: ass.append(i) if i * i == N: continue ass.append(N // i) return ass def main(): A, B = map(int, input().split()) for a in divisor(A): if a % B == 0: print('YES') exit() print('NO') if __name__ == "__main__": main()