const main = input => (
    (a, b, c) => [...Array(+a)]
        .map((_, i) => i + 1)
        .find(y => (b * y + c) % a == 0)
        ? 'YES' : 'NO'
)(...input.trim().split(' '));

console.log(main(require('fs').readFileSync('/dev/stdin', 'utf8')));