'use strict'
function Main(input) {
  let input = input.split("\n")
  let tmp = input[0].split(" ")
  console.log(tmp[0] % tmp[1] === 0 ? 0 : 1)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"))