program ABC060B
    implicit none
    integer(8)::A,B,C,i
    integer(8)::flg=0
    read(5,*)A,B,C

    do i=1,B
        if(mod(A*i,B)==C)then
            flg=1
            print'(A)',"YES"
            exit
        end if
    end do

    if(flg==0)then
        print'(A)',"NO"
    end if
end program ABC060B