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

module.exports = f

function Main(input) {
  const [_n, _k] = input.split("\n").split(" ")
  const n = parseInt(_n, 10)
  const k = parseInt(_k, 10)

  f(n, k)
}

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