import std.stdio, std.algorithm, std.array, std.conv, std.typecons; void main() { auto tmp = readln.split.to!(uint[]); auto N = tmp[0], M = tmp[1]; uint[] A; foreach (i; 1 .. N+1) { uint mod = 1; foreach (m; 0 .. M) { mod = (i*mod) % N; } A ~= mod; } bool[uint] Aset; foreach (a; A) Aset[a] = true; writeln(Aset.length == N ? "Yes" : "No"); }