n,m= map(int,input().split()) def p(n): a = [] while n % 2 == 0: a.append(2) n //= 2 f = 3 while f * f <= n: if n % f == 0: a.append(f) n //= f else: f += 2 if n != 1: a.append(n) sa=set(a) return sa if m%n != 0: sa=p(n) if len(sa) == 2: if 2 not in sa or 5 not in sa: print('Yes') exit() else: print('Yes') exit() print('No')