local function gcd(a,b)
    if b == 0 then
        return a
    else
        return gcd(b, a % b)
    end
end
-----
local A,B,C = io.read("n","n","n")
local m = A % B
local function solve()
    if m == 0 then
        return C == 0
    else
        local g = gcd(B, m)
        if g == 1 then
            return true
        else
            return C % g == 0
        end
    end
end
print(solve() and 'YES' or 'NO')