import java.util.Scanner

fun main(args:Array<String>){
    val scanner=Scanner(System.`in`)

    val a=scanner.nextInt()
    val b=scanner.nextInt()

    if (a%b==0) println(0)
    else println(1)
    
}