// A: Crackers
"use strict";

const DEBUG_MODE = false;
const rawInput = DEBUG_MODE
  ? "6 3"
  : require("fs")
      .readFileSync("/dev/stdin", "utf8")
      .trim();

const process = input => {
  const processedInput = input.split(" ");
  const crackerCount = parseInt(processedInput[0]);
  const peopleCount = parseInt(processedInput[1]);

  const output = crackerCount % peopleCount > 0 ? 1 : 0;

  console.log(output);
};

process(rawInput);
