Module Module1

    Sub Main()
        'let
        Dim tmp As String() = Split(Console.ReadLine())
        Dim N As Long = tmp(0)
        Dim K As Long = tmp(1)

        'var
        Dim ans As Long = Math.Abs(CLng(N Mod K <> 0))

        Console.WriteLine(ans)

    End Sub

End Module