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

  return [n, k]
}

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

module.exports = {
  f,
  parse,
}

function Main(input) {
  const arr= parse(input)
  const n = arr[0]
  const k = arr[1]

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

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