#include <bits/stdc++.h>
using namespace std;

int main(void) {
    int N,K;
    cin >> N >> K;
    if(N%K) cout << "1\n";
    else cout << "0\n";
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N,K;
  cin>>N>>K;
  cout<<((N%K)+K-1)/K<<endl;
}
