#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); long long N,P; cin >> N >> P; if((N+1)%P == 0 || gcd(N+1,P-1) != 1) cout << "Yes\n"; else cout << "No\n"; }