#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9) + 7;

int main(void) {
	int n, k;
	cin >> n >> k;
	
	if( n % k == 0 ) cout << 0 << endl;
	else cout << 1 << endl;
	
	return 0;
}

#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <cmath>
#define endl "\n"
using namespace std;

void solve()
{   int x,y; cin >> x >> y;
    cout << x*y;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    solve();
}
