M,D=map(int,input().split()) p=M*100+D print("YNeos"[any(p%d<1for d in range(2,p))::2])