// A - AtCoder Crackers
// https://beta.atcoder.jp/contests/abc105/tasks/abc105_a

import scala.io.StdIn.readLine

object Main extends App {

  val Array(n, k) = readLine.split(" ").map(_.toInt)

  val diff = if (n%k == 0) 0 else 1

  println(diff)

}