N,P=map(int,input().split()) N+=1 import math print("YNeos"[N%P>0and math.gcd(N,P-1)<2::2])