program sample
    implicit none
  
    integer(8) :: i,j,m,n,a,b,c
    integer(8),allocatable :: x(:),y(:)
  
    read(*,*) a,b,c
    do i=1,b
        if(mod(a*i,b)==c)then
            write(*,*)'YES'
            stop
        end if
    enddo

  
    write(*,*) 'NO'

  
    stop
end program sample
  

