#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001001001001
#define mod 1000000007
#define mod2 998244353
#define pi acos(-1)
#define all(v) v.begin(),v.end()
int main(){
    int N,K;cin>>N>>K;
    if(N%K==0){
        cout<<0<<endl;
    }else{
        cout<<1<<endl;
    }
}
#include <bits/stdc++.h>
using namespace std;
const int64_t INF=999999999;

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