program prob3
    implicit none
    integer :: a, b, c
    integer :: i
    read(*,*) a, b, c
    do i = 1, 100
        if(mod(a*i, b) == c)then
            write(*,'(a)') 'YES'
            stop
        end if
    end do

    write(*,'(a)') 'NO'
    stop
contains
end program prob3