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