#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,k;cin>>n>>k;
  int ans = 0; if (n%k > 0) ans++;
  cout << ans << endl;
}

#include <iostream>

using namespace std;

int main(void) {
  int N, K;
  cin >> N >> K;

  if(N % K == 0){
    cout << "0" << endl;
  }else{
    cout << "1" << endl;
  }
  return 0;
}