Imports System.Collections.Generic
Imports System.Console

Module Program
    Sub Main()
        Dim tmp As String() = Split(Console.ReadLine())
        Dim N As Long = tmp(0)
        Dim K As Long = tmp(1)
        
        Dim Ans As Integer
        If N Mod K = 0 Then
            Ans = 0
        Else
            Ans = 1
        End If
        Console.WriteLine(Ans)
    End Sub
End Module
