program main
  implicit none
  integer :: a, b, c, 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"
end program main
