program prob3
    implicit none
    integer(8)::a,b,c,i,tmp
    read(*,*) a,b,c

    tmp = 0
    do i = 1, 1000
        tmp = tmp + a
        if(mod(tmp,b) == c) then
            write(*,'(a)') "YES"
            stop
        end if
    end do
    write(*,'(a)') "NO"
    stop
end program