program sample
implicit none
integer(8) :: i,j,maxdivision
integer(8) :: x,y,z
real(8),allocatable :: a(:),b(:)

read(*,*) x,y,z

do i=1,100
if (mod(x,i)==0 .and. mod(y,i)==0) then
maxdivision=i
end if
end do

if (mod(z,maxdivision)==0) then
write(*,*) 'YES'
else
write(*,*) 'NO'
end if

end program sample