function f(n, k) {
  return Math.ceil(n / k) - Math.floor(n / k)
}

function Main(input) {
  var arr = input.split("\n").split(" ")
  var n = parseInt(arr[0], 10)
  var k = parseInt(arr[1], 10)

  console.log(f(n, k))
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"))
