import std;

alias sread = () => readln.chomp();
alias lread = () => readln.chomp.to!long();
alias aryread(T = long) = () => readln.split.to!(T[]);

void main()
{
    long a, b, c;
    scan(a, b, c);
    foreach (i; 1 .. 10 ^^ 3)
    {
        if ((a * i) % b == c)
        {
            writeln("YES");
            return;
        }
    }
    writeln("NO");
}

void scan(L...)(ref L A)
{
    auto l = readln.split;
    foreach (i, T; L)
    {
        A[i] = l[i].to!T;
    }
}
