N,P=map(int,input().split()) from math import gcd x=gcd(N+1,P-1) if (N+1)%P==0: print('Yes') exit() if x==1: print('No') else: print('Yes')