program answer
  implicit none

  integer :: A, B, C, i, d
  read(*,*) A, B, C

  do i = 1, 100
     d=A*i
     if(mod(d,B)==C) then
        write(*,*) 'YES'
        stop
     end if
  end do

  write(*,*) 'NO'
  stop
 end program answer