'use strict'

function main(input) {

  input = input.split(/\n|\s/).map(v => ~~v)

  const ans = (input[0] % input[1] === 0) ? 0 : 1

  console.log(ans)
}

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