_, b = map(int, input().split()) if b == 1: print('Yes') exit() ans = 'Yes' if 10**10000 % b else 'No' print(ans)