program main
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: n,k

    read*, n,k
    if (mod(n,k) == 0) then
        print'(i0)', 0
    else
        print'(i0)', 1
    end if
end program main