#include <bits/stdc++.h>
#define rep(i,n) for (int (i) = 0; (i) < (n); i++)
#define ll long long
using namespace std;
int main() {
  ll n,m; cin >> n >> m;
  if(n % m == 0){
    cout << "0";
  }
  else{
    cout << "1";
  }
}
#include <bits/stdc++.h>
using namespace std;

int main() {
  int A, B;
  cin >> A >> B;
  
  int S = A + B;
  int T = A - B;
  int U = A * B;
  
  if (S >= T && S >= U) {
    cout << S << endl;
  } else if (T >= S && T >= U) {
    cout << T << endl;
  } else {
    cout << U << endl;
  }
}